Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Live Simulation Vs Market Replay

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Live Simulation Vs Market Replay

    Hi,

    I've just recently started testing my auto strategy in a Live simulation and noticed that for some reason on some days my entry signals and stoploss modification don't fire when it should (so basically being ignored). Where as on other days this isn't the case.

    But if I run the same period in market replay 20 mins later after the occurence, the entry signals and the stoploss modification fire correctly.

    I can't figure out why this is the case.

    Do you have any suggestions as to why this would happen?

    Cheers.

    #2
    Originally posted by Frankriso View Post
    Hi,

    I've just recently started testing my auto strategy in a Live simulation and noticed that for some reason on some days my entry signals and stoploss modification don't fire when it should (so basically being ignored). Where as on other days this isn't the case.

    But if I run the same period in market replay 20 mins later after the occurence, the entry signals and the stoploss modification fire correctly.

    I can't figure out why this is the case.

    Do you have any suggestions as to why this would happen?

    Cheers.
    What kind of orders are you using?
    Last edited by koganam; 11-02-2012, 05:56 AM. Reason: Corrected spelling.

    Comment


      #3
      Frankriso, when you run this live, are you sure the entry condition as programmed in did fire as you would expect? Have you confirmed this via for example debug prints?

      If you run this with TraceOrders enabled, would at those times be ignored orders found?

      Comment


        #4
        Hi Bertrand,

        What seems to be the issue is I have an entry signal as per the below

        if (High[1] < High[0])
        {
        do something
        }

        The [0] Bar as it's live is the issue as it's over-riding the stop modification strategy. Which doesn't seem to happen in market replay.

        Is there a way around this? Or can I only really have a bar[0] entry or the stop modification strategy ?

        Comment


          #5
          You should be able to do both actions, the OnBarUpdate() call would run sequentially through all code used. If I understand correctly the entry did not trigger live as you would expect, so the first thing you would need to understand via debug prints is why this was the case. Do you replay on self recorded data here, as different data source could also be contributing here.

          Comment


            #6
            Hi,

            To be more clear here I'll give you the sequence of events as they happen.

            1/ My strategy triggers a LONG entry.

            2/ Upon the strategy going LONG the Below strategy code also triggers a working order entry to go potentially SHORT on a break below the LOW of the previous bar.

            if (High[1] < High[0])
            {
            do something
            }

            In realtime LIVE simulation upon the LONG entry triggering, An attempt is made by the coding to enter orders for the STOPLOSS/PROFIT TARGET modification, but is immediately replaced by the above working order to potentially go SHORT.

            This leaves the LONG position with no working exit orders.

            My ideal outcome is the have;
            a) The working order for the potential SHORT position live
            and
            b) The Stoploss/Profit Target modification orders for the current LONG position also live.

            Is This Possible ?

            Please note if my stoploss orders were working Live the LONG position would be exited before the Short Entry point thus not having any issue there.

            Comment


              #7
              Frankriso, thanks for the clarifications - which order types / NinjaScript methods are you using in your script? Would you mind posting the TraceOrders debug out for your scenario experienced so we could review and advise?

              Comment


                #8
                Hi Bertrand,

                I've decided to change my strategy around as the below entry signals only happen 1 or 2 times a trading session so I'll just do this manually.

                I also have an issue with my auto strategy of it shutting down in a particular circumstance, where it tries to enter a Sell on Stop order above the market. This is fine and happens very rarely, but how can I auto restart my strategy when this happens?

                Is there a setting?

                Or is the only way to manually restart the strategy?

                Cheers.

                Comment


                  #9
                  Hi Frankriso, you could only Disable() programmatically but not reenable once the realtime error handling has terminated your script.

                  One way would be disabling the realtime error handling for this strategy and dealing with the rejection via your code -

                  Comment

                  Latest Posts

                  Collapse

                  Topics Statistics Last Post
                  Started by argusthome, 03-08-2026, 10:06 AM
                  0 responses
                  88 views
                  0 likes
                  Last Post argusthome  
                  Started by NabilKhattabi, 03-06-2026, 11:18 AM
                  0 responses
                  48 views
                  0 likes
                  Last Post NabilKhattabi  
                  Started by Deep42, 03-06-2026, 12:28 AM
                  0 responses
                  30 views
                  0 likes
                  Last Post Deep42
                  by Deep42
                   
                  Started by TheRealMorford, 03-05-2026, 06:15 PM
                  0 responses
                  34 views
                  0 likes
                  Last Post TheRealMorford  
                  Started by Mindset, 02-28-2026, 06:16 AM
                  0 responses
                  68 views
                  0 likes
                  Last Post Mindset
                  by Mindset
                   
                  Working...
                  X