Announcement

Collapse

Looking for a User App or Add-On built by the NinjaTrader community?

Visit NinjaTrader EcoSystem and our free User App Share!

Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
See more
See less

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:	46
Size:	7.8 KB
ID:	1289715Click image for larger version

Name:	image.png
Views:	44
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.
    Brandon H.NinjaTrader Customer Service

    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
        Brandon H.NinjaTrader Customer Service

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by dcriador, Today, 01:43 AM
        1 response
        2 views
        0 likes
        Last Post dcriador  
        Started by louiseruch, Today, 01:11 AM
        0 responses
        1 view
        0 likes
        Last Post louiseruch  
        Started by kujista, Today, 12:39 AM
        0 responses
        5 views
        0 likes
        Last Post kujista
        by kujista
         
        Started by tonynt, 05-21-2019, 06:27 AM
        11 responses
        536 views
        1 like
        Last Post NinjaTrader_Jason  
        Started by fitspressotablettry, Today, 12:36 AM
        0 responses
        1 view
        0 likes
        Last Post fitspressotablettry  
        Working...
        X