Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Not all trades are occuring in Strategy

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

    Not all trades are occuring in Strategy

    I developed a strategy that requires confirmation across multiple indicators. The strategy appeared to work, but in market replay i noticed there are times trades are not occurring when they in fact should, as i have validated multiple times the conditions have been met for the trade to occur. is there a way to validate all trades are taking place or meet the required conditions?

    ​​

    Attached Files
    Last edited by ageeholdings; 02-20-2025, 05:40 AM.

    #2
    Hello ageeholdings,

    Thank you for your post.

    To understand why the script is behaving as it is, such as placing orders or not placing orders 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
    Gaby V.NinjaTrader Customer Service

    Comment


      #3
      Thank you!

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by RosySmit, Today, 01:35 AM
      0 responses
      6 views
      0 likes
      Last Post RosySmit  
      Started by gmacjapan, Today, 01:27 AM
      0 responses
      4 views
      0 likes
      Last Post gmacjapan  
      Started by WHICKED, 06-27-2023, 12:07 PM
      95 responses
      1,148 views
      1 like
      Last Post diegocml  
      Started by gmacjapan, Yesterday, 11:47 PM
      0 responses
      7 views
      0 likes
      Last Post gmacjapan  
      Started by gregorious13, Yesterday, 11:43 PM
      0 responses
      5 views
      0 likes
      Last Post gregorious13  
      Working...
      X