fxDreema

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

    Different order execution backtest and realmode

    Questions & Answers
    2
    8
    862
    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.
    • R
      Rommen last edited by

      Good day,

      I made an EA that on backtest using tickdata traded during a bar (I'm using 30minutes), but now on realmode it's trading on the open of the next bar and I didn't change anything in the EA.

      So first it would take a short trade at 13.25:11, but now it opens it at 13.30.

      Do you have any idea what causes this?

      Kind regards,
      Erik

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

        30 min CCI EURUSD? This should be able to open a new trade in the middle of a candle, because "Once per bar" is after the conditions, and conditions are for candle 0. But it's probably not impossible to meet all conditions right in the beginning of a new candle?

        1 Reply Last reply Reply Quote 0
        • R
          Rommen last edited by

          For 30 min CCI EURUSD / USDJPY and GBPUSD, they all open positions at open of the new bar instead of during the BAR. They did open trades in the backtest during the bars.

          But you see nothing wrong with the code? Could the broker be the problem during live trading? (Oanda).

          Thanks for the reply.

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

            At the beginning of the new candle, are all of the conditions true?

            This EA also uses multiple timeframes - M30, H1, H4, Daily. I will suggest to check your indicators with "Indicator tester". Who knows, maybe there is something that I am missing here. And also be sure that you are using this EA, not some other EA with the same name 🙂

            1 Reply Last reply Reply Quote 0
            • R
              Rommen last edited by

              Well at the beginning of the candle all conditions are true.
              But they are also true during the candle. The larger timeframes have an > or < indicator and no crossing. The timeframe I trade is triggered by a cross as you can see, so I think the problem is the 30 minute timeframe. It doesn't "see" the cross during the current candle and just notices it after the close of the candle, which is strange cause during backtesting it "sees" the cross happening during the candle.

              I'm at work now but will run the indicator tester tonight.

              Thanks again.

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

                No, there is no such thing like "after" here. Conditions are checked on every tick, again and again, multiple times per minute and sometimes multiple times per second. Everything happens at the moment - if all conditions are true, "Once per bar" is reached and a new trade is created. Then, most probably the conditions remain true, but "Once per bar" will not work until a new candle is created.

                Do you have some logs or screenshots? I don't know how much time it will take if I put this EA to work on a live account 🙂

                1 Reply Last reply Reply Quote 0
                • R
                  Rommen last edited by

                  I was wrong. I just totally mismatched my backtesting prices and real trading prices.
                  Execution reallife is on the same time as backtest.

                  Thanks for your help and sorry for my stupidness.

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

                    It always happen to me to do something stupid as well, we are on the same boat 🙂

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

                    Online Users

                    T
                    A
                    S

                    9
                    Online

                    146.9k
                    Users

                    22.4k
                    Topics

                    122.6k
                    Posts

                    Powered by NodeBB Forums | Contributors