fxDreema

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

    Why first trades on demo account does not get the right values?

    Questions & Answers
    2
    6
    1605
    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.
    • J
      josecortesllobat last edited by josecortesllobat

      Hello

      This is something that I am seeing using my EAs on a demo account and happens backtesting as well.

      The problem is that some values are not updated correctly for the first trade that the EA opens. On backtesting is not a big problem but on the demo account it is.

      0_1546451978581_bb6d990f-c55f-4933-9cb1-69c2b3f0bf1a-image.png

      0_1546452361403_c8293e91-016b-46be-b50d-df5330c82814-image.png

      It might be a specific issue of my EAs but I am not sure.

      Has anybody seen this particular behavior?

      Thanks

      1 Reply Last reply Reply Quote 0
      • M
        miro1360 last edited by

        How is the comment block updated?

        Between trading and gambling is a very small gap, be careful.

        1 Reply Last reply Reply Quote 0
        • J
          josecortesllobat last edited by

          Hi @miro1360

          Thanks for helping.

          The EA opens a trade if the conditions are met at the beginning of a new bar ("Once Per Bar"). After the position is created, the value TP1_Pips and other position info is stored in variables

          0_1546530471194_62102ebf-cf02-4c2f-85f6-178cbc2b85c9-image.png

          Looking at what I have explained above, I have added a new branch that stores again the value for TP1_Pips if the position exists but for "every tick".

          0_1546531170261_9acfdd9f-4d4e-4909-b9a7-d2243ee9b1c3-image.png

          The problem I think is happening is that TP1_Pips value is not stored correctly for the first trade of the EA. Because if the "Comment" is showing

          TP1_Pips = 0.0 but the TP line has been placed correctly on the chart,

          0_1546531420797_cbe39bbf-309e-4cd0-81df-d55e4941ad9f-image.png

          it looks like that the value has not been stored correctly. This issue seems to be specific for the first trade because it does not happen for the next ones.

          1 Reply Last reply Reply Quote 0
          • M
            miro1360 last edited by miro1360

            Separate comment block form other blocks, place it alone, like this:
            https://ctrlv.cz/shots/2019/01/03/U4W1.png

            or "re-run" this comment block with the block called Run blocks after the update of each variable

            Between trading and gambling is a very small gap, be careful.

            1 Reply Last reply Reply Quote 0
            • J
              josecortesllobat last edited by josecortesllobat

              Hi @miro1360

              Thanks for your advice. I placed that "Comment" block as you suggested and it works fine on backtest.

              0_1546544596942_76bdf01b-3588-4b0a-b845-e8302d26faf4-image.png

              0_1546544506479_35b5a9d1-4807-4b1f-8f18-8ad0779a1bb7-image.png

              GOOD JOB!!!!

              I will check this out on demo account.

              :-()

              1 Reply Last reply Reply Quote 0
              • J
                josecortesllobat last edited by josecortesllobat

                Hello @miro1360

                It looks that is working corectly on demo account as well.

                0_1546583689824_24f15781-1df9-4c29-80c4-f5c778101f97-image.png

                Thanks!!!

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

                Online Users

                M
                M
                E
                C
                M
                F
                L
                F
                F
                E
                K

                29
                Online

                146.6k
                Users

                22.4k
                Topics

                122.6k
                Posts

                Powered by NodeBB Forums | Contributors