Forums Development Trading made REALLY Simple

This topic has been reported for inappropriate content

Tagged: 

Viewing 25 posts - 351 through 375 (of 456 total)
  • Author
    Posts
  • #11463
    gg53
    Participant

      How to EA Logic:

      Now, after we have our SL, TP (?), Lots etc. and trading pre-conditions, we can implement the EA’s Logic itself.

      This will be done in much the same way – by using FUNCTION calls (CS=CurrencyStrength, CM=ClearMethod, VZO=VolumeZoneOscillator, mySentimet=UserParam preference or Neutral):

            //— LONG position (BUY) possibility
      if (CS()==1. && CM()==1. && VZO==1. && mySentiment==1.)
      {
      ticket=OrderSend(Symbol(),OP_BUY,Lots,….,Magic,0,Blue);
      [etc.]

            //— SHORT position (SELL) possibility
      if (CS()==-1. && CM()==-1. && VZO==-1. && mySentiment==-1.)
      {
      ticket=OrderSend(Symbol(),OP_SELL,Lots,….,Magic,0,Red);
      [etc.]

      using this method the EA can easily be modified by changing/adding/deleting conditions without rewriting the whole logic.

      Details on each function will follow.

      G.

      #11477
      ZARtrader
      Participant

        Hello Guys, Dont want to be rude, and with all respect, but the title of thsi thread is : trading made REALLY simple… But the thing is thaht i understand nothing :cry: Is it really SIMPLE ?

        I also don’t see anything simple in this thread, this is a thread about coding as far as I can tell and there is nothing simple about coding

        #11480
        simplex
        Moderator

          I also don’t see anything simple in this thread, this is a thread about coding as far as I can tell and there is nothing simple about coding

          I must admit that there are trading terminals that have programming interfaces which are easier to handle for coding newbies than MT4.

          But in the end, some coding is supposed to make trading easier. If you want other tools than the built-in RSI, MA, etc. you or somebody else has to code those tools. That’s a matter of fact. And I disagree that this thread is about coding only – the Coders’ Lounge is over here.

          And I partially agree in one point: coding isn’t easy for everybody, but nearly everybody having some analytical skills can learn the basics, sufficient diligence assumed.

          s.

          A good trader is a realist who wants to grab a chunk from the body of a trend, leaving top- and bottom-fishing to people on an ego trip. (Dr. Alexander Elder)

          #11484
          gg53
          Participant

            Hello Guys, Dont want to be rude, and with all respect, but the title of thsi thread is : trading made REALLY simple… But the thing is thaht i understand nothing :cry: Is it really SIMPLE ?

            I also don’t see anything simple in this thread, this is a thread about coding as far as I can tell and there is nothing simple about coding

            I’ll consider changing the thread name to:

            “Watch-out: misleading title !!”

             

            G.

            #11487
            ZARtrader
            Participant

              LMFAO :lol:  maybe you should G, LOL thanks for the laugh though, on a more serious note though, is this thread about you guys building an EA

              to trade for you which makes trading ”REALLY” simple?

              • This reply was modified 10 years, 2 months ago by ZARtrader.
              #11493
              gg53
              Participant

                LMFAO :lol: maybe you should G, LOL thanks for the laugh though, on a more serious note though, is this thread about you guys building an EA to trade for you which makes trading ”REALLY” simple?

                This thread is about building an EA, based on Currency-Strength, Price-Action patterns, and Volume behaviour.

                That’s the way I trade, for years, on a daily basis.

                The Community EA should make this task available to everyone, and should make that task as simple as possible.

                 

                G.

                #11494
                simplex
                Moderator

                  I think it’s time to update my formerly posted ‘GG53 compilation’ pdf to provide an overview of the most significant posts in both ‘really simple’ threads.

                  May also serve as sort of specification sheet for fellow coders.

                  s.

                  Attachments:
                  You must be logged in to view attached files.

                  A good trader is a realist who wants to grab a chunk from the body of a trend, leaving top- and bottom-fishing to people on an ego trip. (Dr. Alexander Elder)

                  #11500
                  simplex
                  Moderator

                    Hey guys:

                    There were private questions relating our Penguin EA v. 1.4. I just forgot to mention that: you have to permit DLL calls when launching the EA, if you haven’t activated DLL use permanently.

                    The event calendar functions require that. If you do not permit DLL, the EA cannot run.

                    s.

                    A good trader is a realist who wants to grab a chunk from the body of a trend, leaving top- and bottom-fishing to people on an ego trip. (Dr. Alexander Elder)

                    #11502
                    simplex
                    Moderator

                      I received a PM about our EA v.1.4 throwing out a message like:

                      2016.02.09 23:57:07 2016.01.04 11:59 Penguin_v_1_4 EURUSD,H4: SellStop Price 1.09038 too close to current price 1.09068 Min distance = 0.00300

                      Hopefully some more detail will follow, so we can start debugging. I have an idea where to look, but more detail would be helpful!

                      If anybody testing the EA gets some error messages, please post!

                      Thanks,

                      s.

                      A good trader is a realist who wants to grab a chunk from the body of a trend, leaving top- and bottom-fishing to people on an ego trip. (Dr. Alexander Elder)

                      #11503
                      smallcat
                      Participant

                        Hey guys: There were private questions relating our Penguin EA v. 1.4. I just forgot to mention that: you have to permit DLL calls when launching the EA, if you haven’t activated DLL use permanently. The event calendar functions require that. If you do not permit DLL, the EA cannot run. s.

                        About the indicators. In order the EA to work, we must create a folder name “__EA”  (without double quote) under   …/MQL4/Indicators/  folder , and copy all indicators needed by the EA to this “MQL4/Indicatos/__EA/”  folder.

                        edit: And thanks for the Pdf too

                        Great work, thanks a lot Simplex :good:

                        • This reply was modified 10 years, 2 months ago by smallcat.
                        #11534
                        kapybara
                        Participant

                          I received a PM about our EA v.1.4 throwing out a message like: 2016.02.09 23:57:07 2016.01.04 11:59 Penguin_v_1_4 EURUSD,H4: SellStop Price 1.09038 too close to current price 1.09068 Min distance = 0.00300 Hopefully some more detail will follow, so we can start debugging. I have an idea where to look, but more detail would be helpful! If anybody testing the EA gets some error messages, please post! Thanks, s.

                           

                          Hi Simplex & Co.

                          Highly appreciate you guys and your effort for the community. As I can’t code, I try my best with testing this EA. So as I mentioned, I got above error while back  testing (see attached log.txt). I tried also forward testing and got the same error, no difference at all. EA run with default settings. So I’m wondering what it might be related to, especially when nobody else mentioned it so far.

                          Thank you,
                          Milan

                          Attachments:
                          You must be logged in to view attached files.
                          #11537
                          moon
                          Participant

                            Hi Simplex & Co. Highly appreciate you guys and your effort for the community. As I can’t code, I try my best with testing this EA. So as I mentioned, I got above error while back testing…

                            Hello, this is not EA error, it is your trading account limitation (stoplevel 30 pips), try to set “StopOrdersBuffer” property 30+ pips.

                            #11545
                            forexdj
                            Participant

                              Hi Simplex & Co. Highly appreciate you guys and your effort for the community. As I can’t code, I try my best with testing this EA. So as I mentioned, I got above error while back testing…

                              Hello, this is not EA error, it is your trading account limitation (stoplevel 30 pips), try to set “StopOrdersBuffer” property 30+ pips.

                              Hi everybody. I have been trying to backtest the EA with the default settings and getting this same error. I even modified the “StopOrdersBuffer” property but the error still persists.

                              Am not a coder, any help will be greatly appreciated.

                              Thanks.

                               

                              #11546
                              simplex
                              Moderator

                                Hi @kapybara & @forexdj !

                                Thanks for reporting. Obviously the problem occurs when functions BuyStop() and SellStop() are called for an entry:

                                double stopLevel = MarketInfo(sym, MODE_STOPLEVEL) * point;
                                if (price - ask <= stopLevel) {
                                Print(__FUNCTION__ + " Price " + price2String(price) + " too close to current price " + price2String(ask) + " Min distance = " + price2String(stopLevel));
                                return;
                                }

                                To have a closer look at your MT4 environment, please download the attached script (no indicator!), compile and run it on a EURUSD chart. It will print several MarketInfo() information in your most recent logfile.

                                Please cut the relevant information into a .txt file and post it here or send it to me via PM (posting would be better so others could look at it, too). The relevant information should look like this:

                                0    11:56:31.006    Script PrintMarketinfo_Post EURUSD,H4: loaded successfully
                                0    11:56:31.036    PrintMarketinfo_Post EURUSD,H4: initialized
                                0    11:56:31.036    PrintMarketinfo_Post EURUSD,H4: Symbol = EURUSD
                                ( ... even more content ... )
                                0    11:56:31.036    PrintMarketinfo_Post EURUSD,H4: Stop level in points ( MODE_STOPLEVEL ) = 0
                                0    11:56:31.036    PrintMarketinfo_Post EURUSD,H4: uninit reason 0
                                0    11:56:31.036    Script PrintMarketinfo_Post EURUSD,H4: removed

                                You will find the logfile in <your_mt4_data_folder>/MQL4/Logs

                                s.

                                Attachments:
                                You must be logged in to view attached files.

                                A good trader is a realist who wants to grab a chunk from the body of a trend, leaving top- and bottom-fishing to people on an ego trip. (Dr. Alexander Elder)

                                #11548
                                simplex
                                Moderator

                                  @VlanFx: maybe it would be a good idea to cut the function from my above posted script and integrate it in the EA. Calling the function once during OnInit() might support debugging.

                                  s.

                                  A good trader is a realist who wants to grab a chunk from the body of a trend, leaving top- and bottom-fishing to people on an ego trip. (Dr. Alexander Elder)

                                  #11552
                                  gg53
                                  Participant

                                    @VlanFx: maybe it would be a good idea to cut the function from my above posted script and integrate it in the EA. Calling the function once during OnInit() might support debugging. s.

                                    Good idea.

                                    Also add “Debug” (true/false) to user’s parameters to optionally activate/deactivate this function in OnInit().

                                     

                                    G.

                                    #11557
                                    kapybara
                                    Participant

                                      Hi Simplex,

                                      Here is output from your script. I run it on 2 brokers where I had the same issue.

                                      Thanx, Milan

                                      • This reply was modified 10 years, 2 months ago by kapybara.
                                      Attachments:
                                      You must be logged in to view attached files.
                                      #11561
                                      simplex
                                      Moderator

                                        Hi kapybara,

                                        Here is output from your script. I run it on 2 brokers where I had the same issue.

                                        Thanks for reporting! According to your output, the error should NOT occur on your GP account, where Stop level in points ( MODE_STOPLEVEL ) = 0. On MaxFx the case is clear with Stop level in points ( MODE_STOPLEVEL ) = 10

                                        As a workaround, please try setting your parameter StopOrdersBuffer to a value greater than the account setting MODE_STOPLEVEL and report back whether this works now. We should be aware of the fact that this will affect EA performance to some minor extent.

                                        I will write a checkup routine that can be called in OnInit() to report if account setting and EA setting show a mismatch. If anybody has additional ideas what to check that way at startup please post! @VlanFx: what’s your opinion about this?

                                        s.

                                        A good trader is a realist who wants to grab a chunk from the body of a trend, leaving top- and bottom-fishing to people on an ego trip. (Dr. Alexander Elder)

                                        #11563
                                        gg53
                                        Participant

                                          simplex,

                                          This check-up routine should be part of the Auto_StopLoss & Auto_Trailing Functions.

                                           

                                          G.

                                          #11564
                                          simplex
                                          Moderator

                                            @gg53,

                                            I’m afraid that this won’t be enough. The circumstances kapybara & forexdj reported will prevent the EA from opening trades. The error occured in functions BuyStop and SellStop. So this particular check has to be made before an entry, but during trailing as well.

                                            s.

                                            A good trader is a realist who wants to grab a chunk from the body of a trend, leaving top- and bottom-fishing to people on an ego trip. (Dr. Alexander Elder)

                                            #11634
                                            TraderTM
                                            Participant

                                              All hi! :-)
                                              First I want to thank all who took part in creation of this EA, and in particular Gg53. Thank you that you share with us secrets! :good:
                                              I read all subject and started testing, but I had some problems! The first PeakTroughEA version was better than the others. In a year she showed a monthly gain of 30% at the fixed lot, and drowdown in 8%.
                                              Version 1.4 at me doesn’t open the order.
                                              Then I started trying earlier version 1.3, but even having disconnected additional settings and having chosen the same period and TP and SL it showed results worse than the first version.
                                              Why so? maybe who has kept settings for version 1.3-1.4? I could continue optimization further.
                                              yours faithfully TM

                                              Attachments:
                                              You must be logged in to view attached files.

                                              Ничто не ново под луной:
                                              Что было, то и будет.
                                              Я завершаю круг и - вновь
                                              Готов бежать по кругу...

                                              #11672
                                              VlanFx
                                              Participant

                                                Hi kapybara,

                                                Here is output from your script. I run it on 2 brokers where I had the same issue.

                                                Thanks for reporting! According to your output, the error should NOT occur on your GP account, where Stop level in points ( MODE_STOPLEVEL ) = 0

                                                Hi simplex

                                                Thanks for v1.4. I finally tested it, works fine on my side.

                                                I checked the reported error, and looks like 0 value for STOPLEVEL doesn’t necessarily mean no restrictions:

                                                A zero value of MODE_STOPLEVEL means either absence of any restrictions on the minimal distance for Stop Loss/Take Profit or the fact that a trade server utilizes some external mechanisms for dynamic level control, which cannot be translated in the client terminal.

                                                So that’s bad news. There can be something running that we can not see and check.

                                                So I opened a demo account at GP and backtested the EA and it worked correctly, Opening trades at 3 pips from actual price with StopLevel showing 0. So now I’m confused.

                                                @kapybara are you still experiencing this problem?

                                                V.

                                                 

                                                 

                                                #11673
                                                kapybara
                                                Participant

                                                  Hey guys,

                                                  Sorry for late response on this. So let’s summarize it. I have 2 demo accounts with MaxFX and GlobalPrime. Both are showing different pending order limitations (see picture).

                                                  And both brokers/accounts are throwing me the same warning:

                                                  0    23:14:37    2016.02.01 12:28  Penguin_v_1_4 EURUSD,H4: SellStop Price 1.08583 too close to current price 1.08613 Min distance = 0.00300

                                                  When I adjusted StopOrdersBuffer to 31.0 pips or 30.1 pips it started to open trades. But BUYSTOP/SELLSTOP ORDER distance 30 pips is way too far.

                                                  Wondering what it might be. I saw you have the same GP broker/demo acc, even Simplex has the same GP broker 950 build. I’m confused a bit :scratch:

                                                   

                                                  Thanks,

                                                  Milan

                                                   

                                                  • This reply was modified 10 years, 2 months ago by kapybara.
                                                  Attachments:
                                                  You must be logged in to view attached files.
                                                  #11680
                                                  Anonymous

                                                    All hi! :-) First I want to thank all who took part in creation of this EA, and in particular Gg53. Thank you that you share with us secrets! :good: I read all subject and started testing, but I had some problems! The first PeakTroughEA version was better than the others. In a year she showed a monthly gain of 30% at the fixed lot, and drowdown in 8%. Version 1.4 at me doesn’t open the order. Then I started trying earlier version 1.3, but even having disconnected additional settings and having chosen the same period and TP and SL it showed results worse than the first version. Why so? maybe who has kept settings for version 1.3-1.4? I could continue optimization further. yours faithfully TM

                                                    I dont think its nesseseary to check scores and to optimize it yet. There is still some stuff left to do/add for it to be ready for this.

                                                    Hi kapybara,

                                                    Here is output from your script. I run it on 2 brokers where I had the same issue.

                                                    Thanks for reporting! According to your output, the error should NOT occur on your GP account, where Stop level in points ( MODE_STOPLEVEL ) = 0.

                                                    Hi simplex Thanks for v1.4. I finally tested it, works fine on my side. I checked the reported error, and looks like 0 value for STOPLEVEL doesn’t necessarily mean no restrictions: A zero value of MODE_STOPLEVEL means either absence of any restrictions on the minimal distance for Stop Loss/Take Profit or the fact that a trade server utilizes some external mechanisms for dynamic level control, which cannot be translated in the client terminal. So that’s bad news. There can be something running that we can not see and check. So I opened a demo account at GP and backtested the EA and it worked correctly, Opening trades at 3 pips from actual price with StopLevel showing 0. So now I’m confused. @kapybara are you still experiencing this problem? V.

                                                    Here is full list of: order limiations

                                                    Some brokers have there chart price shifted with the actual price (MarketsWach have always the correct price .. MarketInfo(functions..).

                                                    This is because Metatrader have only one price fees and if brokers have more than one price to offer there costumers it could mess there chartprice.

                                                    I have only found two brokers that have this, FXCM (only if account currency is USD) and HotForex but there is more of them out there.

                                                    So for example, if EA is trying to create the Buystop and the real Ask price is equal or above the price that it is trying to create the order on (this price is taken from chart) than it could not create order. iLow iHigh, and all indicators are using chartprice so we have to shift it if there is a diff from the actual price.

                                                    Not many people know about this and I have only found 1 more EA exept mine on MQL Market that have this corrected.

                                                    We can check this in OnInit() and then correct all prices we use from chart.

                                                    Here is shift code example:

                                                    int OnInit(void)

                                                    {

                                                    RefreshRates(); // very important!!

                                                    chartoffset = MarketInfo(symbol, MODE_BID) – iClose(symbol, 0, 0);

                                                    if (chartoffset != 0) PrintFormat(“Chartprice is shifted with %.f points”, chartoffset / Point);

                                                    now we add this to ‘orderprice + chartoffset’ to have it corrected.

                                                     

                                                     

                                                    #11682
                                                    simplex
                                                    Moderator

                                                      @kapybara:

                                                      Wondering what it might be. I saw you have the same GP broker/demo acc, even Simplex has the same GP broker 950 build. I’m confused a bit

                                                      Yes, a bit confusing! Milan, would you mind asking GP Support for an explanation of this issue? You’re the one whose account is hit by those limitations, so I think it makes sense that you would ask.

                                                      If their support does not provide a satisfactory answer, you might place your question in public via Steve Hopwood’s forum, where GP has a partner account. I remember their partner Jemook @ SHF to be really helpful and honest in replying to issues.

                                                      I’m sure most of us will be interested in their answer.

                                                      s.

                                                      A good trader is a realist who wants to grab a chunk from the body of a trend, leaving top- and bottom-fishing to people on an ego trip. (Dr. Alexander Elder)

                                                    Viewing 25 posts - 351 through 375 (of 456 total)
                                                    • You must be logged in to reply to this topic.
                                                    Scroll to Top