Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Creating a dashboard

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

    Creating a dashboard

    I am creating one strategy which will contain five other strategies I have all in one. I am testing that each strategy works in this combined strategy to verify that everything is working well, however the results are not the same since some orders are not triggering on the dashboard. Here is an example where the individual strategy sends its profit target and it triggers, while on the dashboard it does not trigger.Click image for larger version

Name:	image.png
Views:	201
Size:	7.8 KB
ID:	1289715Click image for larger version

Name:	image.png
Views:	187
Size:	7.4 KB
ID:	1289716​​

    #2
    Hello CuchoFef,

    Thanks for your notes.

    If the expected trade(s) are not appearing, this would indicate that the condition to place the order is not evaluating as true or the order is being ignored for other reasons.

    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 values of every variable used in every condition that places an order along with the time of that bar.

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

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

    ​Below is a link to a forum post that demonstrates how to use prints to understand behavior.
    https://ninjatrader.com/support/foru...121#post791121

    Also, keep an eye on the Log tab of the Control Center for any error messages that may appear while running the strategy.
    <span class="name">Brandon H.</span><span class="title">NinjaTrader Customer Service</span><iframe name="sig" id="sigFrame" src="/support/forum/core/clientscript/Signature/signature.php" frameborder="0" border="0" cellspacing="0" style="border-style: none;width: 100%; height: 120px;"></iframe>

    Comment


      #3
      I have done these things, and have also looked at the orders, and the order is being submitted, it is just not being filled when I backtest the strategy with the dashboard, however it does get filled when I backtest the strategy alone

      Comment


        #4
        Hello CuchoFef,

        Thanks for your notes.

        If the single strategy is working as expected but the other strategy that contains the logic of multiple strategies is not be having as expected then there would likely be an issue with the logic of the script and further debugging would need to be done understand how the other strategy is behaving in comparison with the single strategy.

        In the screenshots you shared it seems the profit target is being hit so the stop loss is canceled which is why the stop loss is not being hit.

        Further debugging would have to be done to understand why the two strategies are behaving differently. In each strategy, add prints that print out all the values being used to submit orders, and print the order object in OnOrderUpdate() to see how the orders are behaving. Then, you could compare the output of the two strategies to see how they are behaving differently.

        ​Below is a link to a forum post that demonstrates how to use prints to understand behavior.
        https://ninjatrader.com/support/foru...121#post791121

        We should also keep in mind that the Strategy Analyzer does not have intrabar information available to accurately fill an order at the exact price and time.

        Please review the help guide document on the differences on real-time vs backtest (historical).
        https://ninjatrader.com/support/helpGuides/nt8/discrepancies_real-time_vs_bac.htm​

        To improve the accuracy of a backtest, you may use Tick Replay along with an added 1-tick series to have logic processed intra-bar and have orders filled intrabar.

        Tick Replay would be used to have the logic process OnEachTick or OnPriceChange with historical data, but this does not allow for intra-bar order fills. You would need to add a single tick data series and submit orders to that single tick data series for a strategy that uses Tick Replay.

        High Order Fill Resolution allows for intra-bar order fills with historical processing, but is not compatible with Tick Replay.

        Please reference the SampleIntrabarBacktest example and the following Help Guide links for more information.

        SampleIntrabarBacktest 'Backtesting NinjaScript Strategies with an intrabar granularity' - https://ninjatrader.com/support/helpGuides/nt8/backtesting_ninjascript_strate.htm

        TickReplay — https://ninjatrader.com/support/help...ick_replay.htm

        Developing for Tick Replay -
        https://ninjatrader.com/support/helpGuides/nt8/developing_for__tick_replay.htm?zoom_highlightsub= developing+for+tick+replay

        Additional information may be found in this NinjaTrader Forum post —
        https://ninjatrader.com/support/forum/forum/ninjatrader-8/strategy-development/100192-comparing-real-time-historical-and-replay-performance?t=102504
        <span class="name">Brandon H.</span><span class="title">NinjaTrader Customer Service</span><iframe name="sig" id="sigFrame" src="/support/forum/core/clientscript/Signature/signature.php" frameborder="0" border="0" cellspacing="0" style="border-style: none;width: 100%; height: 120px;"></iframe>

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by NullPointStrategies, Yesterday, 05:17 AM
        0 responses
        58 views
        0 likes
        Last Post NullPointStrategies  
        Started by argusthome, 03-08-2026, 10:06 AM
        0 responses
        133 views
        0 likes
        Last Post argusthome  
        Started by NabilKhattabi, 03-06-2026, 11:18 AM
        0 responses
        73 views
        0 likes
        Last Post NabilKhattabi  
        Started by Deep42, 03-06-2026, 12:28 AM
        0 responses
        45 views
        0 likes
        Last Post Deep42
        by Deep42
         
        Started by TheRealMorford, 03-05-2026, 06:15 PM
        0 responses
        50 views
        0 likes
        Last Post TheRealMorford  
        Working...
        X