Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Real time stoploss not working....

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

    Real time stoploss not working....

    So I am running this strategy I created, but I noticed that my stop orders are NEVER placed.....
    When I look at the historical backtest data everything is fine. When we get to realtime markets I have to keep watching it due to it not placing my stop for some reason....

    Please help me out, because it is driving me bonkers... Even with over a decade of c# and trading experience...

    Image 1: It placed the short limit, it entered and ones that happens it should place my ExitShortStopMarket... But it didn't do it.... I had to manually close once again because on realtime data it does not do it.
    Image 2: once the order happened and the realtime bars became historical it "magically" placed everything perfect....

    So how is my code executed?
    onbarupdate() checks entry conditions and places short / long limits. Examples below:

    Code:
    string entryId = Time[0].ToString("dddd:HH:mm") + "-" + tradeManager.CurrentSessionFirstPresentation.Size;
    tradeManager.EntryOrder = EnterShortLimit(0, true, contractsToUseInShort, entry, entryId);
    tradeManager.placedOrders.Add(tradeManager.EntryOr der);
    
    tradeManager.StoplossOrder = ExitShortStopMarket(0, true, contractsToUseInShort, tradeManager.CurrentStoploss, "Stoploss", "");
    tradeManager.placedOrders.Add(tradeManager.Stoplos sOrder);
    OnOrderUpdate() checks if everything is filled and if so, it will start placing limit orders for tp and a stop also.

    Code:
     protected override void OnOrderUpdate(Cbi.Order order, double limitPrice, double stopPrice,
    int quantity, int filled, double averageFillPrice,
    Cbi.OrderState orderState, DateTime time, Cbi.ErrorCode error, string comment)
        {
            if (error != ErrorCode.NoError)
            {
                Print($"{Time[0]}: Order '{order.Name}' error: {error}");
            }
            else if (tradeManager.EntryOrder != null)
            {
                if (order.OrderState == OrderState.Rejected)
                {
                    if (Position.MarketPosition == MarketPosition.Long)
                    {
                        ExitLong(int.MaxValue);
                    }else if(Position.MarketPosition == MarketPosition.Short)
                    {
                        ExitShort(int.MaxValue);
                    }
                    else
                    {
                        ExitAllOrders();
                    }
                } else if (orderState == OrderState.Filled && order.Name == tradeManager.EntryOrder.Name)
                {
                    tradeManager.HaveBeenInATrade = true;
                    if (Position.MarketPosition == MarketPosition.Long)
                    {
                        if (GetCurrentBid() < tradeManager.CurrentStoploss)
                        {
                            ExitAllOrders();
                        }
                        else
                        {
                            CalculateNewTpAndSl(true, false, false);
                        }
                    }
                    else if (Position.MarketPosition == MarketPosition.Short)
                    {
                        if (GetCurrentAsk() > tradeManager.CurrentStoploss)
                        {
                            ExitAllOrders();
                        }
                        else
                        {
                            CalculateNewTpAndSl(false, false, false);
                        }
                    }
                }
            }
        }​


    CalculateNewTpAndSl() makes sure the TP and SL are placed. Aka this does not happen on real time data...

    Code:
    private void CalculateNewTpAndSl(bool isLong, bool firstTpHit, bool breakevenPlaced)
            {
               //removed the most logic of the code but in short long limit orders are placed and the stoploss is being placed with the method below. For shorts the other exitshortstopmarket() is used
               tradeManager.StoplossOrder = ExitLongStopMarket(0, true, int.MaxValue, tradeManager.CurrentStoploss, "Stoploss", "");
               tradeManager.placedOrders.Add(tradeManager.StoplossOrder);
    ​           
    }

    #2
    Hello mw_futures,

    Thank you for your post.

    To understand why the script is behaving as it is, such as placing orders or not placing orders or drawing objects when expected, it is necessary to add prints to the script that print the values used for the logic of the script to understand how the script is evaluating.

    In the strategy add prints (outside of any conditions) that print the date time of the bar and all values compared in every condition that places an order.

    The prints should include the time of the bar and should print all values from all variables and all hard coded values in all conditions that must evaluate as true for this action to be triggered. It is very important to include a text label for each value and for each comparison operator in the print to understand what is being compared in the condition sets.

    The debugging print output should clearly show what the condition is, what time the conditions are being compared, all values being compared, and how they are being compared.


    Prints will appear in the NinjaScript Output window (New > NinjaScript Output window).


    Further, enable TraceOrders which will let us know if any orders are being ignored and not being submitted when the condition to place the orders is evaluating as true.

    After enabling TraceOrders remove the instance of the strategy from the Configured list in the Strategies window and add a new instance of the strategy from the Available list.


    I am happy to assist you with analyzing the output from the output window.


    Run or backtest the script and when the output from the output window appears save this by right-clicking the output window and selecting Save As... -> give the output file a name and save -> then attach the output text file to your reply.


    Below is a link to a support article that demonstrates using informative prints to understand behavior and includes a link to a video recorded using the Strategy Builder to add prints.

    https://support.ninjatrader.com/s/ar...nd-TraceOrders

    Comment


      #3
      Originally posted by NinjaTrader_Gaby View Post
      Hello mw_futures,

      Thank you for your post.

      To understand why the script is behaving as it is, such as placing orders or not placing orders or drawing objects when expected, it is necessary to add prints to the script that print the values used for the logic of the script to understand how the script is evaluating.

      In the strategy add prints (outside of any conditions) that print the date time of the bar and all values compared in every condition that places an order.

      The prints should include the time of the bar and should print all values from all variables and all hard coded values in all conditions that must evaluate as true for this action to be triggered. It is very important to include a text label for each value and for each comparison operator in the print to understand what is being compared in the condition sets.

      The debugging print output should clearly show what the condition is, what time the conditions are being compared, all values being compared, and how they are being compared.


      Prints will appear in the NinjaScript Output window (New > NinjaScript Output window).


      Further, enable TraceOrders which will let us know if any orders are being ignored and not being submitted when the condition to place the orders is evaluating as true.

      After enabling TraceOrders remove the instance of the strategy from the Configured list in the Strategies window and add a new instance of the strategy from the Available list.


      I am happy to assist you with analyzing the output from the output window.


      Run or backtest the script and when the output from the output window appears save this by right-clicking the output window and selecting Save As... -> give the output file a name and save -> then attach the output text file to your reply.


      Below is a link to a support article that demonstrates using informative prints to understand behavior and includes a link to a video recorded using the Strategy Builder to add prints.

      https://support.ninjatrader.com/s/ar...nd-TraceOrders
      Dear NinjaTrader_Gaby,

      P.S. The strategy itself I am normally running from the control center only to ensure the drawing do not take up any cpu space or RAM.
      The second image was to confirm what should had happened afterwards. During the trade I was watching it clean with trading activated to see orders placed.
      As mentioned, the limit order was placed in realtime but the stops not.

      I enabled my debug print statements for the CalculateNewTpAndSl() method and added traceOrders.
      I am unsure if running a backtest will help due to the fact that backtest data / historical data and trades seem to work.
      Only real time does not seem to work.

      But for the sake of conversation I am now running a sim account live to see if any trades will show up.
      attached you will find the log on historical data from this morning.

      If a live trade occurs I will have a look at the log and post it also here.

      Kind regards, Jelle (MW)
      Attached Files
      Last edited by mw_futures; 04-08-2025, 09:09 AM.

      Comment


        #4
        Dear NinjaTrader_Gaby,

        After analyzing the log I send in the previous message I found this line:
        08/04/2025 09:50:00 Strategy 'MWFuturesLiquidityScalper/355578757': Ignored SubmitOrderManaged() method at 08/04/2025 09:50:00: BarsInProgress=0 Action=BuyToCover OrderType=StopMarket Quantity=10 LimitPrice=0 StopPrice=18136,00 SignalName='Stoploss' FromEntrySignal='' Reason='This was an exit order but no position exists to exit'
        this line corresponds to:
        Code:
        tradeManager.StoplossOrder = ExitShortStopMarket(0, true, int.MaxValue, tradeManager.CurrentStoploss, "Stoploss", "");
        1) Could this specific line act differently on historical data compared to live data?
        2) Also, I only execute this piece of code when the entry order has the orderstate.Filled. So how come it says "ignored"

        I am unsure if this is the issue for the difference in live vs historical data?

        Kind regards, Jelle
        Last edited by mw_futures; 04-08-2025, 09:24 AM.

        Comment


          #5
          Unfortunately these prints aren't descriptive enough to understand how the condition are evaluating, or even what the conditions are.

          The prints should include the time of the bar and should print all values from all variables and all hard coded values in all conditions that must evaluate as true for an action to be triggered. It is very important to include a text label for each value and for each comparison operator in the print to understand what is being compared in the condition sets.

          The debugging print output should clearly show what the condition is, what time the conditions are being compared, all values being compared, and how they are being compared.

          Below is a link to a support article that demonstrates using informative prints to understand behavior and includes a link to a video recorded using the Strategy Builder to add prints.

          https://support.ninjatrader.com/s/ar...nd-TraceOrders

          If you need assistance creating a print please let me know.​

          Comment


            #6
            Dear NinjaTrader_Gaby,

            The conditions are not the issue, because the code executed to get to that log is placing the orders. as mentioned in my message earlier:

            After analyzing the log I send in the previous message I found this line:
            08/04/2025 09:50:00 Strategy 'MWFuturesLiquidityScalper/355578757': Ignored SubmitOrderManaged() method at 08/04/2025 09:50:00: BarsInProgress=0 Action=BuyToCover OrderType=StopMarket Quantity=10 LimitPrice=0 StopPrice=18136,00 SignalName='Stoploss' FromEntrySignal='' Reason='This was an exit order but no position exists to exit'
            this line corresponds to:
            Code:tradeManager.StoplossOrder = ExitShortStopMarket(0, true, int.MaxValue, tradeManager.CurrentStoploss, "Stoploss", "");
            1) Could this specific line act differently on historical data compared to live data?
            2) Also, I only execute this piece of code when the entry order has the orderstate.Filled. So how come it says "ignored"

            I am unsure if this is the issue for the difference in live vs historical data?​
            I added some extra information to the debug line in the onOrderUpdate().

            Is this more what you are looking for?
            As you see it displaying
            1. "Time 08/04/2025 09:50:00 - In OnOrderUpdate: 'orderState == OrderState.Filled && order.Name == tradeManager.EntryOrder.Name Position.MarketPosition == MarketPosition.Long GetCurrentBid() > tradeManager.CurrentStoploss"
            2. afterwards it gets into my method to place the orders (seeing the ordertrace)
            3. printing the exits and stoploss
            If you need more information, I am happy to help, I just need to know what you need. My program is over 3k lines of code, so adding debug lines for all logic besides this (where the orders are placed) seems not really usefull.

            Kind regards, Jelle
            Attached Files

            Comment


              #7
              Originally posted by mw_futures View Post
              Dear NinjaTrader_Gaby,

              The conditions are not the issue, because the code executed to get to that log is placing the orders. as mentioned in my message earlier:



              I added some extra information to the debug line in the onOrderUpdate().

              Is this more what you are looking for?
              As you see it displaying
              1. "Time 08/04/2025 09:50:00 - In OnOrderUpdate: 'orderState == OrderState.Filled && order.Name == tradeManager.EntryOrder.Name Position.MarketPosition == MarketPosition.Long GetCurrentBid() > tradeManager.CurrentStoploss"
              2. afterwards it gets into my method to place the orders (seeing the ordertrace)
              3. printing the exits and stoploss
              If you need more information, I am happy to help, I just need to know what you need. My program is over 3k lines of code, so adding debug lines for all logic besides this (where the orders are placed) seems not really usefull.

              Kind regards, Jelle
              NinjaTrader_Gaby, I reworked the code a little to see what happens on the limit order fill of the images provided in the main message.
              I also reworked something to get rid of the first message where the order was ignored.
              In the log below we see when we enter the onOrderUpdate before order placements and after.
              We see that the stoploss is placed. Again this is the log for historical data. I would have to wait for a realtime example to be given.
              But this now does show that the "code" works.

              08/04/2025 09:50:00 Strategy 'MWFuturesLiquidityScalper/355578759': Entered internal SubmitOrderManaged() method at 08/04/2025 09:50:00: BarsInProgress=0 Action=SellShort OrderType=Limit Quantity=10 LimitPrice=18114,00 StopPrice=0 SignalName='Tuesday:09:50-6,25' FromEntrySignal=''
              Time 08/04/2025 09:50:00 - In OnOrderUpdate(after placing SHORT orders): 'orderState == OrderState.Filled && order.Name == tradeManager.EntryOrder.Name Position.MarketPosition == MarketPosition.Long GetCurrentask() > tradeManager.CurrentStoploss
              errorcode: NoError
              orderstate:Filled
              order name: Tuesday:09:50-6,25
              entry order: orderId='NT-00028-4437' account='Sim101' name='Tuesday:09:50-6,25' orderState=Filled instrument='MNQ JUN25' orderAction=SellShort orderType='Limit' limitPrice=18114 stopPrice=0 quantity=10 tif=Gtc oco='' filled=10 averageFillPrice=18114 onBehalfOf='' id=-1 time='2025-04-08 09:50:00' gtd='2099-12-01' statementDate='2025-04-08'
              current entry order name: Tuesday:09:50-6,25
              current entry order state: Filled
              current stoploss order: NULL
              current bid: 18108,25
              current ask 18108,25
              market position: Short
              08/04/2025 09:50:00 Strategy 'MWFuturesLiquidityScalper/355578759': Entered internal SubmitOrderManaged() method at 08/04/2025 09:50:00: BarsInProgress=0 Action=BuyToCover OrderType=Limit Quantity=2 LimitPrice=17964,50 StopPrice=0 SignalName='Exit Short 17964,5(2)' FromEntrySignal=''
              08/04/2025 09:50:00 Strategy 'MWFuturesLiquidityScalper/355578759': Entered internal SubmitOrderManaged() method at 08/04/2025 09:50:00: BarsInProgress=0 Action=BuyToCover OrderType=Limit Quantity=1 LimitPrice=17926,00 StopPrice=0 SignalName='Exit Short 17926(1)' FromEntrySignal=''
              08/04/2025 09:50:00 Strategy 'MWFuturesLiquidityScalper/355578759': Entered internal SubmitOrderManaged() method at 08/04/2025 09:50:00: BarsInProgress=0 Action=BuyToCover OrderType=Limit Quantity=1 LimitPrice=17808,00 StopPrice=0 SignalName='Exit Short 17808(1)' FromEntrySignal=''
              08/04/2025 09:50:00 Strategy 'MWFuturesLiquidityScalper/355578759': Entered internal SubmitOrderManaged() method at 08/04/2025 09:50:00: BarsInProgress=0 Action=BuyToCover OrderType=Limit Quantity=1 LimitPrice=17758,25 StopPrice=0 SignalName='Exit Short 17758,25(1)' FromEntrySignal=''
              08/04/2025 09:50:00 Strategy 'MWFuturesLiquidityScalper/355578759': Entered internal SubmitOrderManaged() method at 08/04/2025 09:50:00: BarsInProgress=0 Action=BuyToCover OrderType=Limit Quantity=1 LimitPrice=17737,75 StopPrice=0 SignalName='Exit Short 17737,75(1)' FromEntrySignal=''
              08/04/2025 09:50:00 Strategy 'MWFuturesLiquidityScalper/355578759': Entered internal SubmitOrderManaged() method at 08/04/2025 09:50:00: BarsInProgress=0 Action=BuyToCover OrderType=Limit Quantity=1 LimitPrice=17694,00 StopPrice=0 SignalName='Exit Short 17694(1)' FromEntrySignal=''
              08/04/2025 09:50:00 Strategy 'MWFuturesLiquidityScalper/355578759': Entered internal SubmitOrderManaged() method at 08/04/2025 09:50:00: BarsInProgress=0 Action=BuyToCover OrderType=Limit Quantity=1 LimitPrice=17691,50 StopPrice=0 SignalName='Exit Short 17691,5(1)' FromEntrySignal=''
              08/04/2025 09:50:00 Strategy 'MWFuturesLiquidityScalper/355578759': Entered internal SubmitOrderManaged() method at 08/04/2025 09:50:00: BarsInProgress=0 Action=BuyToCover OrderType=Limit Quantity=1 LimitPrice=17668,50 StopPrice=0 SignalName='Exit Short 17668,5(1)' FromEntrySignal=''
              08/04/2025 09:50:00 Strategy 'MWFuturesLiquidityScalper/355578759': Entered internal SubmitOrderManaged() method at 08/04/2025 09:50:00: BarsInProgress=0 Action=BuyToCover OrderType=StopMarket Quantity=2.147.483.647 LimitPrice=0 StopPrice=18136,00 SignalName='Stoploss' FromEntrySignal=''
              08/04/2025 09:50:00:
              Placing exit SHORT: 17964,5 - 2 Contracts
              Placing exit SHORT: 17926 - 1 Contracts
              Placing exit SHORT: 17808 - 1 Contracts
              Placing exit SHORT: 17758,25 - 1 Contracts
              Placing exit SHORT: 17737,75 - 1 Contracts
              Placing exit SHORT: 17694 - 1 Contracts
              Placing exit SHORT: 17691,5 - 1 Contracts
              Placing exit SHORT: 17668,5 - 1 Contracts
              Stoploss: 18136(10)
              Go to breakeven price: 17964,5
              Time 08/04/2025 09:50:00 - In OnOrderUpdate(after placing SHORT orders): 'orderState == OrderState.Filled && order.Name == tradeManager.EntryOrder.Name Position.MarketPosition == MarketPosition.Long GetCurrentask() > tradeManager.CurrentStoploss
              errorcode: NoError
              orderstate:Filled
              order name: Tuesday:09:50-6,25
              entry order: orderId='NT-00028-4437' account='Sim101' name='Tuesday:09:50-6,25' orderState=Filled instrument='MNQ JUN25' orderAction=SellShort orderType='Limit' limitPrice=18114 stopPrice=0 quantity=10 tif=Gtc oco='' filled=10 averageFillPrice=18114 onBehalfOf='' id=-1 time='2025-04-08 09:50:00' gtd='2099-12-01' statementDate='2025-04-08'
              current entry order name: Tuesday:09:50-6,25
              current entry order state: Filled
              current stoploss order: orderId='NT-00037-4437' account='Sim101' name='Stoploss' orderState=Working instrument='MNQ JUN25' orderAction=BuyToCover orderType='Stop Market' limitPrice=0 stopPrice=18136 quantity=2.147.483.647 tif=Gtc oco='' filled=0 averageFillPrice=0 onBehalfOf='' id=-1 time='2025-04-08 09:50:00' gtd='2099-12-01' statementDate='2025-04-08'
              current bid: 18108,25
              current ask 18108,25
              market position: Short​

              Comment


                #8
                NinjaTrader_Gaby ​example of real time placement now....
                For some reason the changes I made fixed it I guess? or it only works on simm accounts?

                Will test it on live again tomorrow....

                08/04/2025 15:22:00 Strategy 'MWFuturesLiquidityScalper/355578759': Entered internal SubmitOrderManaged() method at 08/04/2025 15:22:00: BarsInProgress=0 Action=Buy OrderType=Limit Quantity=15 LimitPrice=17207,75 StopPrice=0 SignalName='Tuesday:15:22-14' FromEntrySignal=''
                Time 08/04/2025 15:22:00 - In OnOrderUpdate(after placing LONG orders): 'orderState == OrderState.Filled && order.Name == tradeManager.EntryOrder.Name Position.MarketPosition == MarketPosition.Long GetCurrentBid() < tradeManager.CurrentStoploss
                errorcode: NoError
                orderstate:Filled
                order name: Tuesday:15:22-14
                entry order: orderId='c36c1495d4df45ed9cdbf34db13556ec' account='Sim101' name='Tuesday:15:22-14' orderState=Filled instrument='MNQ JUN25' orderAction=Buy orderType='Limit' limitPrice=17207.75 stopPrice=0 quantity=15 tif=Gtc oco='' filled=15 averageFillPrice=17207.6833333333 onBehalfOf='' id=46 time='2025-04-08 15:22:37' gtd='2099-12-01' statementDate='2025-04-08'
                current entry order name: Tuesday:15:22-14
                current entry order state: Filled
                current stoploss order: NULL
                current bid: 17206,75
                current ask 17207,25
                market position: Long
                08/04/2025 15:22:37 Strategy 'MWFuturesLiquidityScalper/355578759': Entered internal SubmitOrderManaged() method at 08/04/2025 15:22:37: BarsInProgress=0 Action=Sell OrderType=Limit Quantity=2 LimitPrice=17704,00 StopPrice=0 SignalName='Exit Long 17704(2)' FromEntrySignal=''
                08/04/2025 15:22:37 Strategy 'MWFuturesLiquidityScalper/355578759': Entered internal SubmitOrderManaged() method at 08/04/2025 15:22:37: BarsInProgress=0 Action=Sell OrderType=Limit Quantity=2 LimitPrice=17761,50 StopPrice=0 SignalName='Exit Long 17761,5(2)' FromEntrySignal=''
                08/04/2025 15:22:37 Strategy 'MWFuturesLiquidityScalper/355578759': Entered internal SubmitOrderManaged() method at 08/04/2025 15:22:37: BarsInProgress=0 Action=Sell OrderType=Limit Quantity=2 LimitPrice=17945,75 StopPrice=0 SignalName='Exit Long 17945,75(2)' FromEntrySignal=''
                08/04/2025 15:22:37 Strategy 'MWFuturesLiquidityScalper/355578759': Entered internal SubmitOrderManaged() method at 08/04/2025 15:22:37: BarsInProgress=0 Action=Sell OrderType=Limit Quantity=2 LimitPrice=18073,75 StopPrice=0 SignalName='Exit Long 18073,75(2)' FromEntrySignal=''
                08/04/2025 15:22:37 Strategy 'MWFuturesLiquidityScalper/355578759': Entered internal SubmitOrderManaged() method at 08/04/2025 15:22:37: BarsInProgress=0 Action=Sell OrderType=Limit Quantity=2 LimitPrice=18134,75 StopPrice=0 SignalName='Exit Long 18134,75(2)' FromEntrySignal=''
                08/04/2025 15:22:37 Strategy 'MWFuturesLiquidityScalper/355578759': Entered internal SubmitOrderManaged() method at 08/04/2025 15:22:37: BarsInProgress=0 Action=Sell OrderType=Limit Quantity=1 LimitPrice=18183,00 StopPrice=0 SignalName='Exit Long 18183(1)' FromEntrySignal=''
                08/04/2025 15:22:37 Strategy 'MWFuturesLiquidityScalper/355578759': Entered internal SubmitOrderManaged() method at 08/04/2025 15:22:37: BarsInProgress=0 Action=Sell OrderType=Limit Quantity=1 LimitPrice=18332,50 StopPrice=0 SignalName='Exit Long 18332,5(1)' FromEntrySignal=''
                08/04/2025 15:22:37 Strategy 'MWFuturesLiquidityScalper/355578759': Entered internal SubmitOrderManaged() method at 08/04/2025 15:22:37: BarsInProgress=0 Action=Sell OrderType=Limit Quantity=1 LimitPrice=18357,25 StopPrice=0 SignalName='Exit Long 18357,25(1)' FromEntrySignal=''
                08/04/2025 15:22:37 Strategy 'MWFuturesLiquidityScalper/355578759': Entered internal SubmitOrderManaged() method at 08/04/2025 15:22:37: BarsInProgress=0 Action=Sell OrderType=StopMarket Quantity=2.147.483.647 LimitPrice=0 StopPrice=17185,75 SignalName='Stoploss' FromEntrySignal=''
                08/04/2025 15:22:00:
                Placing exit LONG: 17704 - 2 Contracts
                Placing exit LONG: 17761,5 - 2 Contracts
                Placing exit LONG: 17945,75 - 2 Contracts
                Placing exit LONG: 18073,75 - 2 Contracts
                Placing exit LONG: 18134,75 - 2 Contracts
                Placing exit LONG: 18183 - 1 Contracts
                Placing exit LONG: 18332,5 - 1 Contracts
                Placing exit LONG: 18357,25 - 1 Contracts
                Stoploss: 17185,75(13)
                Go to breakeven price: 17704
                Time 08/04/2025 15:22:00 - In OnOrderUpdate(after placing LONG orders): 'orderState == OrderState.Filled && order.Name == tradeManager.EntryOrder.Name Position.MarketPosition == MarketPosition.Long GetCurrentBid() < tradeManager.CurrentStoploss
                errorcode: NoError
                orderstate:Filled
                order name: Tuesday:15:22-14
                entry order: orderId='c36c1495d4df45ed9cdbf34db13556ec' account='Sim101' name='Tuesday:15:22-14' orderState=Filled instrument='MNQ JUN25' orderAction=Buy orderType='Limit' limitPrice=17207.75 stopPrice=0 quantity=15 tif=Gtc oco='' filled=15 averageFillPrice=17207.6833333333 onBehalfOf='' id=46 time='2025-04-08 15:22:37' gtd='2099-12-01' statementDate='2025-04-08'
                current entry order name: Tuesday:15:22-14
                current entry order state: Filled
                current stoploss order: orderId='eb4c51f0e175409f889890461e2e6061' account='Sim101' name='Stoploss' orderState=Submitted instrument='MNQ JUN25' orderAction=Sell orderType='Stop Market' limitPrice=0 stopPrice=17185.75 quantity=13 tif=Gtc oco='' filled=0 averageFillPrice=0 onBehalfOf='' id=55 time='2025-04-08 15:22:37' gtd='2099-12-01' statementDate='2025-04-08'
                current bid: 17207,25
                current ask 17208
                market position: Long​
                Click image for larger version

Name:	image.png
Views:	106
Size:	129.1 KB
ID:	1340011

                Comment


                  #9
                  Hello mw_futures,

                  Apologies, I didn't see your latest message before I posted my last one.

                  Reason='This was an exit order but no position exists to exit'
                  This basically means what it sounds like, an exit order was submitted, but there was no position to exit. This could mean either the entry position wasn't filled yet, or it's possible that the position was exited by other means (it's not clear from what has been posted if this would be possible based on your strategy's logic).

                  1) Could this specific line act differently on historical data compared to live data?
                  A strategy, in general, will perform differently on live data vs backtest. Live orders are filled on an exchange with a trading partner on an agreed upon price based on market dynamics. Backtest (historical) orders are not using these market dynamics. Instead these are filled based on logical rules from processing historical data.
                  • When in historical data, only the Open, High, Low, and Close will be available and there will be no intra-bar data.
                    • This means actions cannot happen intra-bar, fills cannot happen intra-bar. All prices and actions come from and occur when the bar closes as this is all the information that is known
                    • Because of this, OnBarUpdate will only update 'On bar close' as it does not have the intra-bar information necessary for 'On price change' or 'On each tick' and the script will not have the intra-bar information to accurately fill an order at the exact price and time.
                  Intra-bar granularity adds a second data series such as a 1 tick series using AddDataSeries() so that the strategy or indicator has the individual ticks in the historical data in between the High and Low of the primary series.
                  In NinjaTrader 8, there have been two new enhancements so that programmers may not have to manually add this secondary series and code the script for high accuracy fills (Order Fill Resolution) or for intra-bar actions (TickReplay) depending on the needs of the script.

                  Note: bar types that are IsRemoveLastBarSupported cannot be used with TickReplay and generally cause inaccurate results when backtesting in historical data.
                  Note: High Order Fill Resolution allows for intra-bar order fills with historical processing, but is not compatible with Tick Replay.

                  Please see this support article for a detailed explanation:


                  So to summarize, for your backtest (historical) performance to match your realtime performance/orders you would need to ensure the script has enabled intrabar granularity. And, if you are not using Calculate.OnBarClose, Tick Replay must also be enabled.

                  2) Also, I only execute this piece of code when the entry order has the orderstate.Filled. So how come it says "ignored"
                  The message tells us that there was no associated position to exit at the time you attempted to submit the exit order. We would need more descriptive prints, especially for the condition you're describing. This way we can see how the condition is evaluating at the time you're submitting the exit order.

                  You can also print the order object from OnOrderUpdate(). Printing the order object in OnOrderUpdate() will allow you to track the progression of the order from submitted, to working, to filled, cancelled, or rejected.

                  I am seeing you have attempted to output some information from OnOrderUpdate, however it's not descriptive, so this information doesn't tell me anything about the order.

                  Code:
                  errorcode: 1
                  orderstate:2
                  order name: 3
                  entry order: 4
                  current entry order name: 5
                  current entry order state: 6
                  current stoploss order: 7
                  current bid: 8
                  current ask 9
                  market position: 10


                  Additionally, I am seeing the following:

                  Code:
                  08/04/2025 08:03:00 Strategy 'MWFuturesLiquidityScalper/355578757': Ignored SubmitOrderManaged() method at 08/04/2025 08:03:00: BarsInProgress=0 Action=BuyToCover OrderType=StopMarket Quantity=13 LimitPrice=0 StopPrice=18022,00 SignalName='Stoploss' FromEntrySignal='' Reason='This was an exit order but no position exists to exit'
                  
                  Time 0 - In OnOrderUpdate: 'orderState == OrderState.Filled && order.Name == tradeManager.EntryOrder.Name Position.MarketPosition == MarketPosition.Long GetCurrentBid() > tradeManager.CurrentStoploss​
                  ​
                  The exit order error is seen before the output message that suggests the entry order is filled. If you are printing this info from OnOrderUpdate, then this suggests that you're submitting the exit before the entry order's status is OrderState.Filled.

                  Comment


                    #10
                    Hey NinjaTrader_Gaby,

                    Thank you for your detailed response.
                    Currently I have been analyzing the traceorders and debug statements during live market and found a flaw in my code.

                    1) before I used limit orders for entry and due to this I got partial fills. To solve this I switched towards using MIT orders for entry to make sure my position get's filled.

                    This however gave the following issue as seen in the image below:​Click image for larger version

Name:	image.png
Views:	169
Size:	24.1 KB
ID:	1340049
                    When using MIT orders, my OnorderUpdate() logic to place stoplosses does not seem to enter the right amount of contracts on my stop
                    Currently for the stop I use
                    ExitShortStopMarket(0, true, int.MaxValue, tradeManager.CurrentStoploss, "Stoploss", "")

                    As you can see I try to use the maxValue to ensure it gets my whole position as a stop.
                    But only 2 buy stops were places instead of the position being 13.

                    below is the log from the traceorders where you see:
                    1) (traceorder) the short being filled
                    2) log line values beginning of the OnOrderUpdate() logic
                    3) (traceorder) placing buy limits (based on Position.Quantity.
                    4) (traceorder) stop placement with max.int
                    5) log line values beginning of the OnOrderUpdate() logic

                    Interesting to see it to compare step 4) and the stoploss order value of 5).

                    2) log line values beginning of the OnOrderUpdate() logic. Because you see that instead of using max.value, it switches to 2.
                    This now begs the question, when using an MIT order, are several order floaded into the onOrderUpdate that are not linked to the initial entry name?
                    Hopefully you are able to help me out here on why they script only sees 2 filled orders when the MIT order fills or provide information on how MIT actually fills in OnOrderUpdate.
                    I am aware that MIT will fill based on market orders once the price has been reached.

                    09/04/2025 05:18:59 Strategy 'MWFuturesLiquidityScalper/355649141': Entered internal SubmitOrderManaged() method at 09/04/2025 05:18:59: BarsInProgress=0 Action=SellShort OrderType=MIT Quantity=13 LimitPrice=0 StopPrice=17347,00 SignalName='Wednesday:05:19-3,75' FromEntrySignal=''
                    Time 09/04/2025 05:19:00 - In OnOrderUpdate(after placing SHORT orders): 'orderState == OrderState.Filled && order.Name == tradeManager.EntryOrder.Name Position.MarketPosition == MarketPosition.Long GetCurrentask() > tradeManager.CurrentStoploss
                    errorcode: NoError
                    orderstate:Filled
                    order name: Wednesday:05:19-3,75
                    entry order: orderId='51a9113cc9d943cd90dd3c262e3ff39e' account='Sim101' name='Wednesday:05:19-3,75' orderState=Filled instrument='MNQ JUN25' orderAction=SellShort orderType='MIT' limitPrice=0 stopPrice=17347 quantity=13 tif=Gtc oco='' filled=13 averageFillPrice=17345.0384615385 onBehalfOf='' id=82 time='2025-04-09 05:19:01' gtd='2099-12-01' statementDate='2025-04-09'
                    current entry order name: Wednesday:05:19-3,75
                    current entry order state: Filled
                    current stoploss order: NULL
                    current bid: 17345,5
                    current ask 17346,75
                    market position: Short
                    AVG fill price: 17345,0384615385
                    On behalve of:
                    Time: 09/04/2025 05:19:00 - CancellAllOrders: resetEntryAndStop = False
                    09/04/2025 05:19:01 Strategy 'MWFuturesLiquidityScalper/355649141': Entered internal SubmitOrderManaged() method at 09/04/2025 05:19:01: BarsInProgress=0 Action=BuyToCover OrderType=Limit Quantity=1 LimitPrice=17306,00 StopPrice=0 SignalName='Exit Short 17306(1)' FromEntrySignal=''
                    09/04/2025 05:19:01 Strategy 'MWFuturesLiquidityScalper/355649141': Entered internal SubmitOrderManaged() method at 09/04/2025 05:19:01: BarsInProgress=0 Action=BuyToCover OrderType=Limit Quantity=1 LimitPrice=17262,50 StopPrice=0 SignalName='Exit Short 17262,5(1)' FromEntrySignal=''
                    09/04/2025 05:19:01 Strategy 'MWFuturesLiquidityScalper/355649141': Entered internal SubmitOrderManaged() method at 09/04/2025 05:19:01: BarsInProgress=0 Action=BuyToCover OrderType=StopMarket Quantity=2.147.483.647 LimitPrice=0 StopPrice=17369,00 SignalName='Stoploss' FromEntrySignal=''
                    09/04/2025 05:19:00: Time: 09/04/2025 05:19:00 -
                    Placing exit SHORT: 17306 - 1 Contracts
                    Placing exit SHORT: 17262,5 - 1 Contracts
                    Stoploss: 17369(2)
                    Go to breakeven price: 17306
                    Time 09/04/2025 05:19:00 - In OnOrderUpdate(after placing SHORT orders): 'orderState == OrderState.Filled && order.Name == tradeManager.EntryOrder.Name Position.MarketPosition == MarketPosition.Long GetCurrentask() > tradeManager.CurrentStoploss
                    errorcode: NoError
                    orderstate:Filled
                    order name: Wednesday:05:19-3,75
                    entry order: orderId='51a9113cc9d943cd90dd3c262e3ff39e' account='Sim101' name='Wednesday:05:19-3,75' orderState=Filled instrument='MNQ JUN25' orderAction=SellShort orderType='MIT' limitPrice=0 stopPrice=17347 quantity=13 tif=Gtc oco='' filled=13 averageFillPrice=17345.0384615385 onBehalfOf='' id=82 time='2025-04-09 05:19:01' gtd='2099-12-01' statementDate='2025-04-09'
                    current entry order name: Wednesday:05:19-3,75
                    current entry order state: Filled
                    current stoploss order: orderId='b9c818802e794c98944b4604814b51d9' account='Sim101' name='Stoploss' orderState=Submitted instrument='MNQ JUN25' orderAction=BuyToCover orderType='Stop Market' limitPrice=0 stopPrice=17369 quantity=2 tif=Gtc oco='' filled=0 averageFillPrice=0 onBehalfOf='' id=85 time='2025-04-09 05:19:01' gtd='2099-12-01' statementDate='2025-04-09'
                    current bid: 17347,5
                    current ask 17348,75
                    market position: Short
                    AVG fill price: 17345,0384615385
                    On behalve of:

                    Kind regards, Jelle (MW)

                    Comment


                      #11
                      Originally posted by mw_futures View Post
                      Hey NinjaTrader_Gaby,

                      Thank you for your detailed response.
                      Currently I have been analyzing the traceorders and debug statements during live market and found a flaw in my code.

                      1) before I used limit orders for entry and due to this I got partial fills. To solve this I switched towards using MIT orders for entry to make sure my position get's filled.

                      This however gave the following issue as seen in the image below:​Click image for larger version  Name:	image.png Views:	0 Size:	24.1 KB ID:	1340049
                      When using MIT orders, my OnorderUpdate() logic to place stoplosses does not seem to enter the right amount of contracts on my stop
                      Currently for the stop I use
                      ExitShortStopMarket(0, true, int.MaxValue, tradeManager.CurrentStoploss, "Stoploss", "")

                      As you can see I try to use the maxValue to ensure it gets my whole position as a stop.
                      But only 2 buy stops were places instead of the position being 13.

                      below is the log from the traceorders where you see:
                      1) (traceorder) the short being filled
                      2) log line values beginning of the OnOrderUpdate() logic
                      3) (traceorder) placing buy limits (based on Position.Quantity.
                      4) (traceorder) stop placement with max.int
                      5) log line values beginning of the OnOrderUpdate() logic

                      Interesting to see it to compare step 4) and the stoploss order value of 5).

                      2) log line values beginning of the OnOrderUpdate() logic. Because you see that instead of using max.value, it switches to 2.
                      This now begs the question, when using an MIT order, are several order floaded into the onOrderUpdate that are not linked to the initial entry name?
                      Hopefully you are able to help me out here on why they script only sees 2 filled orders when the MIT order fills or provide information on how MIT actually fills in OnOrderUpdate.
                      I am aware that MIT will fill based on market orders once the price has been reached.

                      09/04/2025 05:18:59 Strategy 'MWFuturesLiquidityScalper/355649141': Entered internal SubmitOrderManaged() method at 09/04/2025 05:18:59: BarsInProgress=0 Action=SellShort OrderType=MIT Quantity=13 LimitPrice=0 StopPrice=17347,00 SignalName='Wednesday:05:19-3,75' FromEntrySignal=''
                      Time 09/04/2025 05:19:00 - In OnOrderUpdate(after placing SHORT orders): 'orderState == OrderState.Filled && order.Name == tradeManager.EntryOrder.Name Position.MarketPosition == MarketPosition.Long GetCurrentask() > tradeManager.CurrentStoploss
                      errorcode: NoError
                      orderstate:Filled
                      order name: Wednesday:05:19-3,75
                      entry order: orderId='51a9113cc9d943cd90dd3c262e3ff39e' account='Sim101' name='Wednesday:05:19-3,75' orderState=Filled instrument='MNQ JUN25' orderAction=SellShort orderType='MIT' limitPrice=0 stopPrice=17347 quantity=13 tif=Gtc oco='' filled=13 averageFillPrice=17345.0384615385 onBehalfOf='' id=82 time='2025-04-09 05:19:01' gtd='2099-12-01' statementDate='2025-04-09'
                      current entry order name: Wednesday:05:19-3,75
                      current entry order state: Filled
                      current stoploss order: NULL
                      current bid: 17345,5
                      current ask 17346,75
                      market position: Short
                      AVG fill price: 17345,0384615385
                      On behalve of:
                      Time: 09/04/2025 05:19:00 - CancellAllOrders: resetEntryAndStop = False
                      09/04/2025 05:19:01 Strategy 'MWFuturesLiquidityScalper/355649141': Entered internal SubmitOrderManaged() method at 09/04/2025 05:19:01: BarsInProgress=0 Action=BuyToCover OrderType=Limit Quantity=1 LimitPrice=17306,00 StopPrice=0 SignalName='Exit Short 17306(1)' FromEntrySignal=''
                      09/04/2025 05:19:01 Strategy 'MWFuturesLiquidityScalper/355649141': Entered internal SubmitOrderManaged() method at 09/04/2025 05:19:01: BarsInProgress=0 Action=BuyToCover OrderType=Limit Quantity=1 LimitPrice=17262,50 StopPrice=0 SignalName='Exit Short 17262,5(1)' FromEntrySignal=''
                      09/04/2025 05:19:01 Strategy 'MWFuturesLiquidityScalper/355649141': Entered internal SubmitOrderManaged() method at 09/04/2025 05:19:01: BarsInProgress=0 Action=BuyToCover OrderType=StopMarket Quantity=2.147.483.647 LimitPrice=0 StopPrice=17369,00 SignalName='Stoploss' FromEntrySignal=''
                      09/04/2025 05:19:00: Time: 09/04/2025 05:19:00 -
                      Placing exit SHORT: 17306 - 1 Contracts
                      Placing exit SHORT: 17262,5 - 1 Contracts
                      Stoploss: 17369(2)
                      Go to breakeven price: 17306
                      Time 09/04/2025 05:19:00 - In OnOrderUpdate(after placing SHORT orders): 'orderState == OrderState.Filled && order.Name == tradeManager.EntryOrder.Name Position.MarketPosition == MarketPosition.Long GetCurrentask() > tradeManager.CurrentStoploss
                      errorcode: NoError
                      orderstate:Filled
                      order name: Wednesday:05:19-3,75
                      entry order: orderId='51a9113cc9d943cd90dd3c262e3ff39e' account='Sim101' name='Wednesday:05:19-3,75' orderState=Filled instrument='MNQ JUN25' orderAction=SellShort orderType='MIT' limitPrice=0 stopPrice=17347 quantity=13 tif=Gtc oco='' filled=13 averageFillPrice=17345.0384615385 onBehalfOf='' id=82 time='2025-04-09 05:19:01' gtd='2099-12-01' statementDate='2025-04-09'
                      current entry order name: Wednesday:05:19-3,75
                      current entry order state: Filled
                      current stoploss order: orderId='b9c818802e794c98944b4604814b51d9' account='Sim101' name='Stoploss' orderState=Submitted instrument='MNQ JUN25' orderAction=BuyToCover orderType='Stop Market' limitPrice=0 stopPrice=17369 quantity=2 tif=Gtc oco='' filled=0 averageFillPrice=0 onBehalfOf='' id=85 time='2025-04-09 05:19:01' gtd='2099-12-01' statementDate='2025-04-09'
                      current bid: 17347,5
                      current ask 17348,75
                      market position: Short
                      AVG fill price: 17345,0384615385
                      On behalve of:

                      Kind regards, Jelle (MW)

                      Another example NinjaTrader_GabyClick image for larger version

Name:	image.png
Views:	129
Size:	35.1 KB
ID:	1340057

                      09/04/2025 07:13:00 Strategy 'MWFuturesLiquidityScalper/355649143': Entered internal SubmitOrderManaged() method at 09/04/2025 07:13:00: BarsInProgress=0 Action=Buy OrderType=MIT Quantity=50 LimitPrice=0 StopPrice=17034,00 SignalName='Wednesday:07:13-20,5' FromEntrySignal=''
                      Time 09/04/2025 07:13:00 - In OnOrderUpdate(after placing LONG orders): 'orderState == OrderState.Filled && order.Name == tradeManager.EntryOrder.Name Position.MarketPosition == MarketPosition.Long GetCurrentBid() < tradeManager.CurrentStoploss
                      errorcode: NoError
                      orderstate:Filled
                      order name: Wednesday:07:13-20,5
                      entry order: orderId='eab7f94aa5df4928acbac27fd45c2f16' account='Sim101' name='Wednesday:07:13-20,5' orderState=Filled instrument='MNQ JUN25' orderAction=Buy orderType='MIT' limitPrice=0 stopPrice=17034 quantity=50 tif=Gtc oco='' filled=50 averageFillPrice=17036.49 onBehalfOf='' id=112 time='2025-04-09 07:13:04' gtd='2099-12-01' statementDate='2025-04-09'
                      current entry order name: Wednesday:07:13-20,5
                      current entry order state: Filled
                      current stoploss order: NULL
                      current bid: 17032
                      current ask 17034
                      market position: Long
                      AVG fill price: 17036,49
                      On behalve of:
                      Quantity: 50
                      Time: 09/04/2025 07:13:00 - CancellAllOrders: resetEntryAndStop = False
                      09/04/2025 07:13:04 Strategy 'MWFuturesLiquidityScalper/355649143': Entered internal SubmitOrderManaged() method at 09/04/2025 07:13:04: BarsInProgress=0 Action=Sell OrderType=Limit Quantity=10 LimitPrice=17372,75 StopPrice=0 SignalName='Exit Long 17372,75(10)' FromEntrySignal=''
                      09/04/2025 07:13:04 Strategy 'MWFuturesLiquidityScalper/355649143': Entered internal SubmitOrderManaged() method at 09/04/2025 07:13:04: BarsInProgress=0 Action=Sell OrderType=Limit Quantity=10 LimitPrice=17382,00 StopPrice=0 SignalName='Exit Long 17382(10)' FromEntrySignal=''
                      09/04/2025 07:13:04 Strategy 'MWFuturesLiquidityScalper/355649143': Entered internal SubmitOrderManaged() method at 09/04/2025 07:13:04: BarsInProgress=0 Action=Sell OrderType=Limit Quantity=10 LimitPrice=17399,00 StopPrice=0 SignalName='Exit Long 17399(10)' FromEntrySignal=''
                      09/04/2025 07:13:04 Strategy 'MWFuturesLiquidityScalper/355649143': Entered internal SubmitOrderManaged() method at 09/04/2025 07:13:04: BarsInProgress=0 Action=Sell OrderType=Limit Quantity=10 LimitPrice=17417,25 StopPrice=0 SignalName='Exit Long 17417,25(10)' FromEntrySignal=''
                      09/04/2025 07:13:04 Strategy 'MWFuturesLiquidityScalper/355649143': Entered internal SubmitOrderManaged() method at 09/04/2025 07:13:04: BarsInProgress=0 Action=Sell OrderType=Limit Quantity=10 LimitPrice=17426,00 StopPrice=0 SignalName='Exit Long 17426(10)' FromEntrySignal=''
                      09/04/2025 07:13:04 Strategy 'MWFuturesLiquidityScalper/355649143': Entered internal SubmitOrderManaged() method at 09/04/2025 07:13:04: BarsInProgress=0 Action=Sell OrderType=StopMarket Quantity=2 LimitPrice=0 StopPrice=17012,00 SignalName='Stoploss' FromEntrySignal=''
                      09/04/2025 07:13:00: Time: 09/04/2025 07:13:00 -
                      Placing exit LONG: 17372,75 - 10 Contracts
                      Placing exit LONG: 17382 - 10 Contracts
                      Placing exit LONG: 17399 - 10 Contracts
                      Placing exit LONG: 17417,25 - 10 Contracts
                      Placing exit LONG: 17426 - 10 Contracts
                      Stoploss: 17012(50)
                      Go to breakeven price: 17372,75
                      Time 09/04/2025 07:13:00 - In OnOrderUpdate(after placing LONG orders): 'orderState == OrderState.Filled && order.Name == tradeManager.EntryOrder.Name Position.MarketPosition == MarketPosition.Long GetCurrentBid() < tradeManager.CurrentStoploss
                      errorcode: NoError
                      orderstate:Filled
                      order name: Wednesday:07:13-20,5
                      entry order: orderId='eab7f94aa5df4928acbac27fd45c2f16' account='Sim101' name='Wednesday:07:13-20,5' orderState=Filled instrument='MNQ JUN25' orderAction=Buy orderType='MIT' limitPrice=0 stopPrice=17034 quantity=50 tif=Gtc oco='' filled=50 averageFillPrice=17036.49 onBehalfOf='' id=112 time='2025-04-09 07:13:04' gtd='2099-12-01' statementDate='2025-04-09'
                      current entry order name: Wednesday:07:13-20,5
                      current entry order state: Filled
                      current stoploss order: orderId='071dc5907b04405ca1ca5d28d1419246' account='Sim101' name='Stoploss' orderState=Submitted instrument='MNQ JUN25' orderAction=Sell orderType='Stop Market' limitPrice=0 stopPrice=17012 quantity=2 tif=Gtc oco='' filled=0 averageFillPrice=0 onBehalfOf='' id=118 time='2025-04-09 07:13:04' gtd='2099-12-01' statementDate='2025-04-09'
                      current bid: 17033,25
                      current ask 17035,5
                      market position: Long
                      AVG fill price: 17036,49
                      On behalve of:
                      Quantity: 50​​

                      Comment


                        #12
                        and another example​ NinjaTrader_Gaby . Hopefully this now gives enough examples on where it looks like we are getting filled with 50, but are not able actually place the right amount of stop contracts.

                        It looks like ExitShortStopMarket maybe uses Position.Quantity and that that property is behind on the onOrderUpdate() when using MIT orders?Click image for larger version

Name:	image.png
Views:	110
Size:	227.5 KB
ID:	1340067

                        Comment


                          #13
                          Hello mw_futures,

                          I would not recommend using int.MaxValue to submit the maximum number of contracts as your quantity parameter..

                          If you want your stop loss quantity to match your strategy's current position quantity, use Position.Quantity.

                          Comment


                            #14
                            Hey NinjaTrader_Gaby ,

                            In the latest images I posted I was using the quantity provided by the onOrderUpdate() method. meaning that for example 50 contracts are filled.
                            If I use that or the Position.Quantity I still get that behavior where the stopmarket order for stoploss creates a lesser contract stoploss.

                            Hence why I think that the exitshortmarketstop() is behind on the event in regards to limiting the amount of contracts that is already in the trade.
                            Perfect example below.

                            Originally posted by mw_futures View Post
                            and another example​ NinjaTrader_Gaby . Hopefully this now gives enough examples on where it looks like we are getting filled with 50, but are not able actually place the right amount of stop contracts.

                            It looks like ExitShortStopMarket maybe uses Position.Quantity and that that property is behind on the onOrderUpdate() when using MIT orders?Click image for larger version  Name:	image.png Views:	0 Size:	227.5 KB ID:	1340067

                            Comment


                              #15
                              NinjaTrader_Gaby hopefully the provided code will give any insights on why this weird behavior is happening.

                              Comment

                              Latest Posts

                              Collapse

                              Topics Statistics Last Post
                              Started by argusthome, 03-08-2026, 10:06 AM
                              0 responses
                              113 views
                              0 likes
                              Last Post argusthome  
                              Started by NabilKhattabi, 03-06-2026, 11:18 AM
                              0 responses
                              60 views
                              0 likes
                              Last Post NabilKhattabi  
                              Started by Deep42, 03-06-2026, 12:28 AM
                              0 responses
                              40 views
                              0 likes
                              Last Post Deep42
                              by Deep42
                               
                              Started by TheRealMorford, 03-05-2026, 06:15 PM
                              0 responses
                              43 views
                              0 likes
                              Last Post TheRealMorford  
                              Started by Mindset, 02-28-2026, 06:16 AM
                              0 responses
                              81 views
                              0 likes
                              Last Post Mindset
                              by Mindset
                               
                              Working...
                              X