fxDreema

    • Register
    • Login
    • Search
    • Back to the main page
    • Categories
    • Recent
    • Tags
    • Popular
    • Search

    Question to community: duration of optimization attached EA

    Questions & Answers
    3
    9
    2785
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • D
      Dieter last edited by

      I have attached an simple ea and the preset for the optimization. Further on I have you attached a picture with the settings for the optimation in the metatrader 4 tester. How long does the optimization with the given settings? I'd love to have a comparison.

      inp2=(2) Weekday filter
      inp2_tradeMonday=1
      inp2_tradeTuesday=1
      inp2_tradeWednesday=1
      inp2_tradeThursday=1
      inp2_tradeFriday=1
      inp2_tradeSaturday=0
      inp2_tradeSunday=0
      inp3=(3) Hours filter
      inp3_StartHour=1
      inp3_StartHour,F=0
      inp3_StartHour,1=1
      inp3_StartHour,2=0
      inp3_StartHour,3=0
      inp3_EndHour=23
      inp3_EndHour,F=0
      inp3_EndHour,1=23
      inp3_EndHour,2=0
      inp3_EndHour,3=0
      inp4=(4) bPriceLevel < bBBLowerBand
      inp4_Ro_BandsPeriod=60
      inp4_Ro_BandsPeriod,F=1
      inp4_Ro_BandsPeriod,1=10
      inp4_Ro_BandsPeriod,2=10
      inp4_Ro_BandsPeriod,3=60
      inp4_Ro_BandsShift=0
      inp4_Ro_BandsShift,F=0
      inp4_Ro_BandsShift,1=0
      inp4_Ro_BandsShift,2=2
      inp4_Ro_BandsShift,3=12
      inp4_Ro_Deviation=2
      inp4_Ro_Deviation,F=0
      inp4_Ro_Deviation,1=1
      inp4_Ro_Deviation,2=1
      inp4_Ro_Deviation,3=5
      inp4_Ro_TIMEFRAME=0
      inp4_Ro_TIMEFRAME,F=0
      inp4_Ro_TIMEFRAME,1=0
      inp4_Ro_TIMEFRAME,2=0
      inp4_Ro_TIMEFRAME,3=0
      inp5=(5) bRsi < bRSIValue
      inp5_Lo_RSIperiod=70
      inp5_Lo_RSIperiod,F=1
      inp5_Lo_RSIperiod,1=5
      inp5_Lo_RSIperiod,2=5
      inp5_Lo_RSIperiod,3=120
      inp5_Lo_TIMEFRAME=0
      inp5_Lo_TIMEFRAME,F=0
      inp5_Lo_TIMEFRAME,1=0
      inp5_Lo_TIMEFRAME,2=0
      inp5_Lo_TIMEFRAME,3=0
      inp5_Ro_Value=60.00000000
      inp5_Ro_Value,F=1
      inp5_Ro_Value,1=5.00000000
      inp5_Ro_Value,2=5.00000000
      inp5_Ro_Value,3=70.00000000
      inp6=(6) bStochMain < bStochValue
      inp6_Lo_Kperiod=85
      inp6_Lo_Kperiod,F=1
      inp6_Lo_Kperiod,1=5
      inp6_Lo_Kperiod,2=5
      inp6_Lo_Kperiod,3=120
      inp6_Lo_Slowing=3
      inp6_Lo_Slowing,F=0
      inp6_Lo_Slowing,1=1
      inp6_Lo_Slowing,2=2
      inp6_Lo_Slowing,3=10
      inp6_Lo_TIMEFRAME=0
      inp6_Lo_TIMEFRAME,F=0
      inp6_Lo_TIMEFRAME,1=0
      inp6_Lo_TIMEFRAME,2=0
      inp6_Lo_TIMEFRAME,3=0
      inp6_Ro_Value=10.00000000
      inp6_Ro_Value,F=1
      inp6_Ro_Value,1=5.00000000
      inp6_Ro_Value,2=5.00000000
      inp6_Ro_Value,3=70.00000000
      inp7=(7) bMaFast > bMaSlow
      inp7_Lo_MAperiod=120
      inp7_Lo_MAperiod,F=1
      inp7_Lo_MAperiod,1=10
      inp7_Lo_MAperiod,2=10
      inp7_Lo_MAperiod,3=600
      inp7_Lo_MAshift=0
      inp7_Lo_MAshift,F=0
      inp7_Lo_MAshift,1=0
      inp7_Lo_MAshift,2=2
      inp7_Lo_MAshift,3=10
      inp7_Lo_TIMEFRAME=0
      inp7_Lo_TIMEFRAME,F=0
      inp7_Lo_TIMEFRAME,1=0
      inp7_Lo_TIMEFRAME,2=0
      inp7_Lo_TIMEFRAME,3=0
      inp7_Ro_MAperiod=430
      inp7_Ro_MAperiod,F=1
      inp7_Ro_MAperiod,1=10
      inp7_Ro_MAperiod,2=15
      inp7_Ro_MAperiod,3=600
      inp7_Ro_MAshift=0
      inp7_Ro_MAshift,F=0
      inp7_Ro_MAshift,1=0
      inp7_Ro_MAshift,2=0
      inp7_Ro_MAshift,3=0
      inp7_Ro_TIMEFRAME=0
      inp7_Ro_TIMEFRAME,F=0
      inp7_Ro_TIMEFRAME,1=0
      inp7_Ro_TIMEFRAME,2=0
      inp7_Ro_TIMEFRAME,3=0
      inp8=(8) bUseCCI 1=Yes, 0=No
      inp8_Ro_Value=0.00000000
      inp8_Ro_Value,F=0
      inp8_Ro_Value,1=0.00000000
      inp8_Ro_Value,2=1.00000000
      inp8_Ro_Value,3=1.00000000
      inp9=(9) bCci < bCciValue
      inp9_Lo_CCIperiod=14
      inp9_Lo_CCIperiod,F=0
      inp9_Lo_CCIperiod,1=5
      inp9_Lo_CCIperiod,2=3
      inp9_Lo_CCIperiod,3=120
      inp9_Ro_Value=20.00000000
      inp9_Ro_Value,F=0
      inp9_Ro_Value,1=5.00000000
      inp9_Ro_Value,2=5.00000000
      inp9_Ro_Value,3=50.00000000
      inp11=(11) Buy pending orders in grid
      inp11_GridOrdersCount=6
      inp11_GridOrdersCount,F=0
      inp11_GridOrdersCount,1=6
      inp11_GridOrdersCount,2=0
      inp11_GridOrdersCount,3=0
      inp11_GridStartOffset=-130.00000000
      inp11_GridStartOffset,F=1
      inp11_GridStartOffset,1=-240.00000000
      inp11_GridStartOffset,2=20.00000000
      inp11_GridStartOffset,3=0.00000000
      inp11_GridSize=40.00000000
      inp11_GridSize,F=1
      inp11_GridSize,1=30.00000000
      inp11_GridSize,2=10.00000000
      inp11_GridSize,3=80.00000000
      inp11_VolumePercent=2.50000000
      inp11_VolumePercent,F=0
      inp11_VolumePercent,1=2.50000000
      inp11_VolumePercent,2=0.00000000
      inp11_VolumePercent,3=0.00000000
      inp11_StopLossPips=290.00000000
      inp11_StopLossPips,F=1
      inp11_StopLossPips,1=200.00000000
      inp11_StopLossPips,2=30.00000000
      inp11_StopLossPips,3=400.00000000
      inp11_GridLevelsGradation=100.00000000
      inp11_GridLevelsGradation,F=0
      inp11_GridLevelsGradation,1=100.00000000
      inp11_GridLevelsGradation,2=0.00000000
      inp11_GridLevelsGradation,3=0.00000000
      inp11_GridVolumesGradation=100.00000000
      inp11_GridVolumesGradation,F=0
      inp11_GridVolumesGradation,1=100.00000000
      inp11_GridVolumesGradation,2=0.00000000
      inp11_GridVolumesGradation,3=0.00000000
      inp11_GridSLgradation=90.00000000
      inp11_GridSLgradation,F=1
      inp11_GridSLgradation,1=10.00000000
      inp11_GridSLgradation,2=10.00000000
      inp11_GridSLgradation,3=100.00000000
      inp13=(13) bUse BE 1=Yes, 0=No
      inp13_Ro_Value=1.00000000
      inp13_Ro_Value,F=0
      inp13_Ro_Value,1=1.00000000
      inp13_Ro_Value,2=0.00000000
      inp13_Ro_Value,3=0.00000000
      inp14=(14) bSetBreakevenAt
      inp14_ProfitAmountPips=50.00000000
      inp14_ProfitAmountPips,F=1
      inp14_ProfitAmountPips,1=10.00000000
      inp14_ProfitAmountPips,2=10.00000000
      inp14_ProfitAmountPips,3=60.00000000
      inp15=(15) Modify stops of trades
      inp15_NewStopLoss=50.00000000
      inp15_NewStopLoss,F=1
      inp15_NewStopLoss,1=10.00000000
      inp15_NewStopLoss,2=5.00000000
      inp15_NewStopLoss,3=60.00000000
      inp15_NewTakeProfit=10.00000000
      inp15_NewTakeProfit,F=1
      inp15_NewTakeProfit,1=10.00000000
      inp15_NewTakeProfit,2=5.00000000
      inp15_NewTakeProfit,3=60.00000000
      inp16=(16) Delete pending orders
      inp17=(17) bCloseRunOrdersAtPips
      inp17_ProfitAmountPips=80.00000000
      inp17_ProfitAmountPips,F=1
      inp17_ProfitAmountPips,1=10.00000000
      inp17_ProfitAmountPips,2=5.00000000
      inp17_ProfitAmountPips,3=100.00000000
      inp18=(18) Close trades
      MagicStart=1389
      MagicStart,F=0
      MagicStart,1=1389
      MagicStart,2=0
      MagicStart,3=0

      ......
      DiWi_Grid_LONG_1.00.mq4
      Screenshot - 27.12.jpg

      1 Reply Last reply Reply Quote 0
      • fxDreema
        fxDreema last edited by

        Mine appears to be slower, but almost there - 3800 tests for 30 minutes. I don't know if I will leave it for another 30 minutes because I also use my laptop for other things 🙂

        1 Reply Last reply Reply Quote 0
        • B
          Blockhead last edited by

          Wow! Sorry I haven't started this ea up yet and tested it.

          You do realize don't you that "optimizing" that many parameters (variables) will find out what was best for the past and not what might work in the future? I read somewhere that the most successful systems are those with the fewest optimized variables. This ea must be a Guiness World Record for quantity of variables 🙂

          1 Reply Last reply Reply Quote 0
          • fxDreema
            fxDreema last edited by

            I ran some benchmarks in MT4 and MT5 and I have some interesting results. Here are the codes I used, scroll down for results.

            int i=0;
            int max=15000000;
            int t0=0;
            int a=1, b=2, c=3;
            
            int init() {
            
               //-- test 1
               t0=GetTickCount();
               for (i=0; i<max; i++) {
                  c=a+b;
               }
               Print("test 1: "+(GetTickCount()-t0)+"ms");
               
               //-- test 2
               t0=GetTickCount();
               for (i=0; i<max; i++) {
                  c=a()+b();
               }
               Print("test 2: "+(GetTickCount()-t0)+"ms");
               
               
               //-- test 4
               t0=GetTickCount();
               for (i=0; i<max; i++) {
                  a();
                  b();
                  a();
                  b();
                  a();
                  b();
                  a();
                  b();
                  a();
                  b();
               }
               Print("test 3: "+(GetTickCount()-t0)+"ms");
            }
            int start() {}
            
            int a() {return(1);}
            int b() {return(2);}
            
            int i=0;
            int max=15000000;
            uint t0=0;
            int a=1, b=2, c=3;
            
            int OnInit() {
            
               
               //-- test 1
               t0=GetTickCount();
               for (i=0; i<max; i++) {
                  c=a+b;
               }
               Print("test 1: "+(string)(GetTickCount()-t0)+"ms");
               
               //-- test 2
               t0=GetTickCount();
               for (i=0; i<max; i++) {
                  c=a()+b();
               }
               Print("test 2: "+(string)(GetTickCount()-t0)+"ms");
               
               //-- test 3
               t0=GetTickCount();
               for (i=0; i<max; i++) {
                  a();
                  b();
                  a();
                  b();
                  a();
                  b();
                  a();
                  b();
                  a();
                  b();
               }
               Print("test 3: "+(string)(GetTickCount()-t0)+"ms");
               
               return(0);
            }
            
            int a() {return(1);}
            int b() {return(2);}
            
            

            I tested what time it takes for an EA to run some functions in a year. I found that there are 11-15 million ticks in a year, at least in one of my MT4 installations (not to mention holes in the history data).

            Both codes are identical, so these tests are the same for MT4 and MT5. Here are the results:

            MetaTrader 4:
            test1: 171 ms
            test2: 2886 ms
            test3: 12215 ms

            MetaTrader 5:
            test1: 47 ms
            test2: 47 ms
            test3: 62 ms

            It looks that MetaTrader 4 loses HUGE amount ot time just to call some functions. In comparison MetaTrader 5 is as fast as it can, there is virtually no matter how many functions do you call in the EA. And these functions are just empty functions that does nothing, if they have to do something it gets even worse for MT4!

            I decided that my MT4 installation could be corrupted, so I tested this on other installations, on other Windows with fresh MT4 installation, even on older MT4 build - it's the same.

            fxDreema is using many many non-empty functions. I didn't expect that MT4 can be so slow in this simple task.

            In any case, I really want someone to try this as well, just to compare the results. Maybe my MT4 does not feel good on my PC, I don't know.

            1 Reply Last reply Reply Quote 0
            • fxDreema
              fxDreema last edited by

              This is so strange that I found that MT4 is so slow in the moment when MT4 is ready to be trashed 😮

              Here is what I'm talking about: http://forum.mql4.com/59477
              The newest MT4 is actually Build 568 from 26 Dec 2013 and here is how to get it:

              • Try to login, with server field set to demo.metaquotes.net:444 (with no success)
              • Apply for a new account, with the demo.metaquotes.net:444 server selected.
              • Shut down the terminal. Reopen this installation of terminal. Update of beta commences and you'll get the new beta installed.

              If needed, restart it once more. What is different now is that experts are located in "MQL4/Experts" folder, so I'm gonna make fxDreema aware of that. I still don't know what problems can come from that MT4 update, but at least I checked function calls - they are normally fast!

              1 Reply Last reply Reply Quote 0
              • D
                Dieter last edited by

                Thank you for you works 🙂 🙂 🙂 .
                I have changed the structure of the code in the meantime. So it is possible to optimize and run this ea on MT4. You can see the results on:

                http://www.myfxbook.com/members/DiWi/al ... 974/789807

                regards,
                Dieter

                1 Reply Last reply Reply Quote 0
                • B
                  Blockhead last edited by

                  __This is so strange that I found that MT4 is so slow in the moment when MT4 is ready to be trashed 😮

                  Here is what I'm talking about: http://forum.mql4.com/59477
                  The newest MT4 is actually Build 568 from 26 Dec 2013 and here is how to get it:

                  • Try to login, with server field set to demo.metaquotes.net:444 (with no success)
                  • Apply for a new account, with the demo.metaquotes.net:444 server selected.
                  • Shut down the terminal. Reopen this installation of terminal. Update of beta commences and you'll get the new beta installed.

                  If needed, restart it once more. What is different now is that experts are located in "MQL4/Experts" folder, so I'm gonna make fxDreema aware of that. I still don't know what problems can come from that MT4 update, but at least I checked function calls - they are normally fast![/quote:1l61polk]

                  fxDreema I am worried that much of your hard work building this wonderful application will have to be redone to be compatible with the new versions of Metatrader. I am not a programmer and so do not know how significant it is, but reading the forum link you posted it seems that this new terminal could be a problem. Or, maybe not, maybe something to your benefit. After reading some of the forum content at mql4 forum specifically about iCustom not working with the new terminal worries me. Being able to find free indicators and then try to implement them into trading ideas is the fun part. How will this new terminal affect all the work you have already done?

                  1 Reply Last reply Reply Quote 0
                  • fxDreema
                    fxDreema last edited by

                    I think it will be better. I have the newest MT4 and it works faster, not only because function calls are faster. I have to admit that fxDreema generally makes slow EAs because of their structure - some little things are needed sometimes, but when they are not needed they are still there... things like that. Even with this, the same EA is faster in the newest MT4 when it is compiled with the newest compiler.

                    I don't know about iCustom really, didn't tried it much, but if it does not work they will fix it. Otherwise all the other stuff looks the same. Ok, "Experts" folder is moved to "MQL4/Experts". I expect things to be better, but it will be best if they just let MT4 and MT5 die and do MT6 🙂

                    Often I'm tired of MT4 and MT5 - both have certain problems. And I don't backtest often! But when I do, with all this crappy history data... I can't imagine how you guys do it.

                    1 Reply Last reply Reply Quote 0
                    • D
                      Dieter last edited by

                      It is difficult to choose between MT4 and MT5. I'll try the new MT4.
                      My way is :
                      1 Calculating the price changes that have occurred in recent years
                      2 What dynamic calculations variables can be calculated , which automatically adapt to the current and future changes?
                      3 Use of FXDreema
                      4 To obtain Optimization Basics
                      5 Invigorate the basic data for all eventualities
                      6 Programming in FXDreama
                      7 validate in Metatrader tester
                      8 Demo test
                      9 validate
                      10 live
                      11. hope to win

                      Item: Calculation of % of Balance for an account (1 Standslot: 100.000 pcs):
                      Lotsize = (%ofBalance/100)*Balance/Lotsize
                      = (100/100)*2000/100000
                      = 0,02 Lot

                      Fxdreama calculate 0.03: see attached ea

                      ......
                      Prozent of Balance.mq4

                      1 Reply Last reply Reply Quote 0
                      • 1 / 1
                      • First post
                        Last post

                      Online Users

                      L
                      A
                      S
                      E

                      12
                      Online

                      146.7k
                      Users

                      22.4k
                      Topics

                      122.6k
                      Posts

                      Powered by NodeBB Forums | Contributors