Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Strategy not showing trade executions from yesterday

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

    Strategy not showing trade executions from yesterday

    I was running a strategy on an account yesterday and it made 2 trades but when I went to look at data in the strategy analyzer I noticed that the trades weren't showing up. I cleared the cache from the ninjatrader documents folder but no luck. I then went into my ninjascript editor and commented out 2 of the entry parameters from the set that made the trades and then they showed up (one parameter dealt with volume compared to its volume MA and the other dealt with a comparison between swings of MNQ and MES). However I had those 2 entry parameters enabled yesterday and it still made those trades. I'm hoping that there's not some big error in the strategy analyzer causing a bunch of inconsistencies in my strategy. Any suggestions?

    #2
    Here's screenshots of my executions yesterday compared with the strategy enabled today
    Attached Files
    Last edited by dj19820; 03-15-2023, 08:26 AM.

    Comment


      #3
      Hello dj19820,

      Thank you for the message.

      Is this a NinjaScript Strategy that you made yourself and are working on yourself, of did you get it from a 3rd party developer and you are just editing it?
      • If you made this yourself, please let us know so we may connect you with the Engineering Support team for further help and assistance
      • If you got this NinjaScript Strategy from a 3rd party developer then you would want to reach back out to them for further help and assistance on why the NinjaScript Strategy is behaving that way.

      Please let us know if we may provide any further assistance.

      Comment


        #4
        I made this myself and working on myself

        Comment


          #5
          Hello dj19820,

          For a strategy instance to show orders made in real-time when previously enabled, it will need to have also submitted those orders at the same time, price, and order type in historical data for these to match when the strategy is re-enabled. The strategy instance must be the same as well (meaning if the instance is removed and a new instance added, the orders from another strategy instance would not be matched or resumed).

          When a real-time order is matched with a historical order, the order will show in the Real-time strategy performance window.

          From the help guide:
          "* A previously generated order is considered to match an active strategy order when the order action, order type, quantity, limit price, and stop price are exactly identical."


          To understand why the strategy is not placing orders in historical at the same time and price, use prints (or write to file) and TraceOrders to debug the script and understand the behavior.

          Enable TraceOrders, print the time of the bar and all values in the condition that submits the entry along with labels for each value and comparison operator.

          Below are links to forum posts on debugging and comparing historical with real-time.

          Citizens of the NinjaTrader Community, A common question we hear from clients is 'why are results from backtest different from real-time or from market replay?'. Live orders are filled on an exchange with a trading partner on an agreed upon price based on market dynamics. Backtest orders are not using these market dynamics.


          Save the output to a text file and include this with your next post.
          Chelsea B.NinjaTrader Customer Service

          Comment


            #6
            I understand why the trades aren't showing up in the strategy analyzer or when the strategy is enabled. It's because the conditions to enter the trade weren't met, yet the trades were executed anyway so I'm concerned if there was some sort of bug or what. If it happens again there's a huge problem.

            Here's my entry conditions for the set that executed the trades a few days ago:

            if ((CrossBelow(Lows[2], Swing1.SwingLow, 2)) // If candle low from 1 bar ago crosses under most recent MNQ swing low
            && (Closes[2][1] > Swing1.SwingLow[2]) // Candle from 1 bar ago closes back above MNQ swing low
            && (Closes[2][0] > Closes[2][1]) // Current candle closes above previous candle close
            && (Lows[1][1] > Swing2.SwingLow[2]) // Candle low from 1 bar ago on MES does not cross below its most recent MES swing low
            && (VOL1[1] > (VOLMA1[1] * 1.3) ) // Volume from 1 candle ago on MNQ is 1.3 times greater than volume MA 100​
            {
            EnterLong(Convert.ToInt32(8), "#3");
            }

            As you can see from the screenshot I have MNQ on top and MES on bottom. MES also crossed below its swing low (where the blue bubbles are marked) so it should not have taken those trades and thats why it doesn't show up in the strategy analyzer. However it executed the trades anyway. Is there a way to see why my live trades were executed? The trace orders only work for trades placed in the strategy but they don't show up when the strategy is enabled.​
            Attached Files

            Comment


              #7
              Hello dj19820,

              May I have you provide the output text files from the prints I have directed you to add in post # 5?

              For us to analyze any behavior, the print output of the values are necessary.
              Chelsea B.NinjaTrader Customer Service

              Comment

              Latest Posts

              Collapse

              Topics Statistics Last Post
              Started by NullPointStrategies, 03-13-2026, 05:17 AM
              0 responses
              87 views
              0 likes
              Last Post NullPointStrategies  
              Started by argusthome, 03-08-2026, 10:06 AM
              0 responses
              151 views
              0 likes
              Last Post argusthome  
              Started by NabilKhattabi, 03-06-2026, 11:18 AM
              0 responses
              80 views
              0 likes
              Last Post NabilKhattabi  
              Started by Deep42, 03-06-2026, 12:28 AM
              0 responses
              53 views
              0 likes
              Last Post Deep42
              by Deep42
               
              Started by TheRealMorford, 03-05-2026, 06:15 PM
              0 responses
              62 views
              0 likes
              Last Post TheRealMorford  
              Working...
              X