Not logged in

Forums

Replies created

Forum Replies Created

Viewing 15 posts - 1 through 15 (of 20 total)
  • FILIPE BONALDO ACERBI
    Customer
    29 Posts

    Hello Mark,

    This is a very good topic. I want share my experience about NN.

    Last year I implement a supervised multi layer perceptron in mql4 with error backpropagation learning method. My inputs is the last X bars highs, lows and closes prices plus another price indicator like moving averages. So, for example, each new bar, the EA gets the last 10 bars highs, lows and closes prices as input for NN. The expected result will be 1 if the future price reach TP (+2 ATR from the last open price) and -1 if the future price reach the ST (-2 ATR from the last open price) .

    The NN run for each bar and I tested for long period but the final result is that the NN didn´t train and don´t have any edge.

    After some research, I discovered that the NN won´t train due the market has multiple patterns or candle patterns and, in this model that I built, I was presenting multiples patterns for NN and it is the why NN was not training. Because each pattern has your edge. The ideal world, is present only one pattern for each NN and try to train this specific pattern.

    So we first must classify similar patterns and input one specific pattern to NN and see if it could be trained.

    So, I find a new approach to implement and I´m working on it for now. First task, is a clustering similar patterns. I found a good algorithm called BIRCH clustering (balanced iterative reducing and clustering using hierarchies) for classify patterns. With BIRCH clustering, I can filter similar patterns like the graph attached.

    As we can see, each rectangle box is a specific pattern and I think that is the best way to implement NN.

    After we have classified the patterns, we presented to a NN and see if could train this specific pattern.

     

     

    Attachments:
    You must be logged in to view attached files.
    FILIPE BONALDO ACERBI
    Customer
    29 Posts

    Hello notch,

    I read about z-score and see that how much negative is more the trades tends to follow a sequence of losses and winners.

    So how much greater the z-score more the portfolio trades tends don´t follow sequences of losses or winners.

    Do you ever try maximize Z-score instead minimize consecutive losses?

    Thanks

     

    FILIPE BONALDO ACERBI
    Customer
    29 Posts

    I thought that only str files could be loaded in QA. It´s helped a lot. Thanks Tomas.

    FILIPE BONALDO ACERBI
    Customer
    29 Posts

    Hello Karish,

    Sorry, I was very busy and I think that invite for Ryver expired.

    Can you resend?

    Thanks

    FILIPE BONALDO ACERBI
    Customer
    29 Posts

    The forum is blocking upload STR files. I will send by support email.

    FILIPE BONALDO ACERBI
    Customer
    29 Posts

    Thanks for your reply. It´s occurring something that I don´t undertand. I tested your strategy with my strategy with the same settings in SQ. The only one difference is that my strategy open limit orders, but the entry rule is the same. So, I think that the same number of pending orders must match the number of trades of your strategy.

    I made two tests on AUDCAD M15 only changing the period. First test period is 01.11.2017 to 30.11-2017 and the second test is 01.10.2017 to 30.11-2017. The first test, my strategy didn´t generate any pending order and your strategy generated one trade. The second test is stranger. My strategy generated 11 pending orders and your strategy generated only 2 trades, where 7 pending orders were opened in november being that first test didn´t generated any order in november.

    I attached the tests. Please let me know if I doing something wrong. Thanks

    FILIPE BONALDO ACERBI
    Customer
    29 Posts

    Generally error 1 is when the EA is trying to set the same values of TP and ST that already setted. It´s not the case?

    FILIPE BONALDO ACERBI
    Customer
    29 Posts

    Hello Karish

    I had the same problem with order modify/delete with my broker. Every new day, I receive the message “market Busy” for the initial 2 mins of the day and the EA fails to change/delete orders. I have EAs running on daily timeframe, so, if it fails at the beginning of the day, it will never change/delete orders. So I implement retry loops for all functions and I don´t have problems anymore. It will make 60 retries for every 30 seconds until change/delete orders. Generally, the EA tries 4 to 6 times to successfully change the order. If you want, try to use this “MT4Functions.inc” attached.

    Attachments:
    You must be logged in to view attached files.
    FILIPE BONALDO ACERBI
    Customer
    29 Posts

    Hello Afhampton,

    I think if the EA make some retries to change the ST/TP for the opened order will work. For the opened stop/limit orders, I think that EA need test if the pending order is opened before try to close or change. If are opened, the EA will call start() function to manage the newly opened orders. It could be a solution. I attached the modified functions and you could try if it work with these modified functions that make retries and test if the pending order is open. Follow this steps:

    1- MAke a backup of “MT4Functions.inc” in C:\StrategyQuant\code\Mql_MT4.

    2 – Download the attached file rename and replace “MT4Functions.inc” in C:\StrategyQuant\code\Mql_MT4.

    3 – Export EA mql4 file again in SQ.

    4 – Test on demo account.

    If The EA fail to change/delete orders, it will make 60 attempts within 30 seconds each one until successfully change/delete the order. If not work, restore the backup.

     

    Attachments:
    You must be logged in to view attached files.
    in reply to: EQUITY CURVE EXPORT #201085
    FILIPE BONALDO ACERBI
    Customer
    29 Posts

    I want to export the equity data to see the maximum drawdown. I have only the drawndown calculated using the closed orders as a base, but I need to calculated the maximum drawdown using the open orders of a portfolio too. I made a portfolio that has a DD of 13% based on closed orders, but, if I take in consideration the open orders balance, the maximum DD increase to 19%!  If it´s not possible to export open balance data, I have to search and calculate manually the balance valleys looking the graph until found the maximum DD.

    FILIPE BONALDO ACERBI
    Customer
    29 Posts

    I searched in the EA code all funtions that modify, delete e close orders. For this functions, I added the same logic that made retries to open orders when failed, which is described by openPosition() function. Today I get “market closed” error but the EA tried until successfully modify/delete/close the orders . If somebody has problem with market closed error, I attached the changed functions to make retries in closing, modifying or deleting orders. You need only replace the functions in EA code.

    Attachments:
    You must be logged in to view attached files.
    FILIPE BONALDO ACERBI
    Customer
    29 Posts

    Hello,

    I have the same problem once a day at 22:00 broker time. I got the error “Market is closed”:

    2017.11.08 22:02:12.599
    USDJPY D1 23.46 USDJPY.m,Daily: 2017.11.09 00:02:19 Order modified, StopLoss: 0, Profit Target: 0
    2017.11.08 22:02:12.599
    USDJPY D1 23.46 USDJPY.m,Daily: modify #175062574 sell stop 0.86 USDJPY.m at 111.617 sl: 112.141 tp: 108.668 ok
    2017.11.08 22:02:12.162
    USDJPY D1 23.46 USDJPY.m,Daily: 2017.11.09 00:02:19 Setting SL/PT, SL: 112.141, PT: 108.668
    2017.11.08 22:02:12.162
    USDJPY D1 23.46 USDJPY.m,Daily: 2017.11.09 00:02:19 Order opened: 175062574 at price:111.617
    2017.11.08 22:02:12.162
    USDJPY D1 23.46 USDJPY.m,Daily: open #175062574 sell stop 0.86 USDJPY.m at 111.617 ok
    2017.11.08 22:02:11.677
    USDJPY D1 23.46 USDJPY.m,Daily: 2017.11.09 00:02:19 Opening order, direction: 5, price: 111.617, Ask: 113.893, Bid: 113.864
    2017.11.08 22:01:37.521
    USDJPY D1 23.46 USDJPY.m,Daily: 2017.11.09 00:01:44 Error opening order: 132 : market is closed
    2017.11.08 22:01:37.396
    USDJPY D1 23.46 USDJPY.m,Daily: 2017.11.09 00:01:44 Opening order, direction: 5, price: 111.617, Ask: 113.893, Bid: 113.864
    2017.11.08 22:01:03.677
    USDJPY D1 23.46 USDJPY.m,Daily: 2017.11.09 00:01:12 Error opening order: 132 : market is closed
    2017.11.08 22:01:03.521
    USDJPY D1 23.46 USDJPY.m,Daily: 2017.11.09 00:01:11 Opening order, direction: 5, price: 111.617, Ask: 113.893, Bid: 113.864
    2017.11.08 22:00:29.568
    USDJPY D1 23.46 USDJPY.m,Daily: 2017.11.09 00:00:35 Error opening order: 132 : market is closed
    2017.11.08 22:00:29.365
    USDJPY D1 23.46 USDJPY.m,Daily: 2017.11.09 00:00:35 Opening order, direction: 5, price: 111.617, Ask: 113.893, Bid: 113.864
    2017.11.08 21:59:55.349
    USDJPY D1 23.46 USDJPY.m,Daily: 2017.11.09 00:00:03 Error opening order: 132 : market is closed
    2017.11.08 21:59:55.052
    USDJPY D1 23.46 USDJPY.m,Daily: 2017.11.09 00:00:02 Opening order, direction: 5, price: 111.617, Ask: 113.893, Bid: 113.864
    2017.11.08 21:59:55.052
    USDJPY D1 23.46 USDJPY.m,Daily: 2017.11.09 00:00:02 Cannot close existing previous pending order with ticket: 174815678, reason: 132

    If we look to the history above, the EA made 4 attempts until successfully open the order 175062574. But, the problem are the failed attempts to change or close the previous order. In the example above, the EA tried to close without success the order 174815678. It tried once and failed, so I have an open order that should have been closed, but because this error, its still opened.

    I have to close the order 174815678 manually and restart the EA. When I did this, the EA opened the right order (see the attachment)

    I tried to solve this problem putting the function if(sqIsTradeAllowed() == 1) before the OrderDelete, but nothing happened:

    bool closePendingOrder() {

    int ticket = OrderTicket();

    if(sqIsTradeAllowed() == 1)  

    if(OrderDelete(ticket)) {

    lastDeletedOrderTicket = ticket;      return(true);   }

    return(false);}

    I think the solution is implement more attempts to close or change a order when it fail.

    What Can I do to solve this?

    in reply to: MAE-MFE DON´T COMPUTE #200952
    FILIPE BONALDO ACERBI
    Customer
    29 Posts

    I have 8GB of memory RAM and I bought more 8gb and insert in my PC. Now I can run the open balances with 16GB RAM without error, but, for PCs with lower RAM, it wont run correctly.

    in reply to: MAE-MFE DON´T COMPUTE #200872
    FILIPE BONALDO ACERBI
    Customer
    29 Posts

    I ran more one time and noticed the following error log:

    Exception in thread “AWT-EventQueue-0” java.lang.OutOfMemoryError: GC overhead limit exceededException in thread “AWT-EventQueue-0” java.lang.OutOfMemoryError: GC overhead limit exceeded at java.awt.image.DataBufferInt.<init>(DataBufferInt.java:75) at java.awt.image.Raster.createPackedRaster(Raster.java:467) at java.awt.image.DirectColorModel.createCompatibleWritableRaster(DirectColorModel.java:1032) at java.awt.image.BufferedImage.<init>(BufferedImage.java:340) at de.javasoft.util.java2d.Synthetica2DUtils.createColorizedImage(Synthetica2DUtils.java:93) at de.javasoft.plaf.synthetica.painter.ImagePainter.drawImage(ImagePainter.java:755) at de.javasoft.plaf.synthetica.painter.ImagePainter.drawTopCenter(ImagePainter.java:648) at de.javasoft.plaf.synthetica.painter.TabbedPanePainter.paintTabbedPaneTab(TabbedPanePainter.java:546) at de.javasoft.plaf.synthetica.painter.TabbedPanePainter.paintTabbedPaneTabBackground(TabbedPanePainter.java:637) at de.javasoft.plaf.synthetica.painter.SyntheticaPainter.paintTabbedPaneTabBackground(SyntheticaPainter.java:874) at javax.swing.plaf.synth.SynthPainter.paintTabbedPaneTabBackground(SynthPainter.java:1779) at javax.swing.plaf.synth.SynthTabbedPaneUI.paintTab(SynthTabbedPaneUI.java:633) at javax.swing.plaf.synth.SynthTabbedPaneUI.paintTabArea(SynthTabbedPaneUI.java:550) at javax.swing.plaf.synth.SynthTabbedPaneUI.paint(SynthTabbedPaneUI.java:480) at javax.swing.plaf.synth.SynthTabbedPaneUI.update(SynthTabbedPaneUI.java:376) at javax.swing.JComponent.paintComponent(JComponent.java:778) at javax.swing.JComponent.paint(JComponent.java:1054) at javax.swing.JComponent.paintChildren(JComponent.java:887) at javax.swing.JComponent.paint(JComponent.java:1063) at javax.swing.JComponent.paintChildren(JComponent.java:887) at javax.swing.JComponent.paint(JComponent.java:1063) at javax.swing.JComponent.paintChildren(JComponent.java:887) at javax.swing.JComponent.paint(JComponent.java:1063) at javax.swing.JComponent.paintChildren(JComponent.java:887) at javax.swing.JSplitPane.paintChildren(JSplitPane.java:1047) at javax.swing.JComponent.paint(JComponent.java:1063) at javax.swing.JComponent.paintChildren(JComponent.java:887) at javax.swing.JComponent.paint(JComponent.java:1063) at javax.swing.JComponent.paintChildren(JComponent.java:887) at javax.swing.JComponent.paint(JComponent.java:1063) at javax.swing.JLayeredPane.paint(JLayeredPane.java:586) at javax.swing.JComponent.paintChildren(JComponent.java:887)15:54:32.223 [AWT-EventQueue-0] INFO  AnalyzerTabPluginClass – Loading ‘Equity chart’ analyzer-tab data

Viewing 15 posts - 1 through 15 (of 20 total)