Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Strategies inconsistently trigger when loaded from chart

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

    Strategies inconsistently trigger when loaded from chart

    I have a handful of Strategies loaded from charts that show up as green on the Strategies Tab. Frequently, I will notice a condition on a chart or two (different instruments) that I know should have triggered a trade, however, there are no trades. If I disable the Strategy and hit [F5] to Reload Ninjascript and then re-enable the Strategy again, the Strategy turns Yellow. I can then see on one or more Charts where trades should have executed but did not.

    This does not happen every time. Sometimes things work as expected. Lately it seems all the losers trigger properly and all the winners are ignored, but I'm sure that might be a slightly biased observation. It just seems that way. I have reproduced this inconsistency on 4 different machines with absolutely nothing extraneous installed on them including a VPS.

    Any thoughts or suggestions would be appreciated. I fully understand inconsistent behavior is the most difficult to troubleshoot.


    #2
    Hello rherbert,

    Thank you for your post.

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

    In order to better understand how the code is working, it will be necessary to use Print to see how the conditions are evaluating and enable TraceOrders to see if orders are being submitted, ignored, rejected, or cancelled.

    I'm also including a link to a forum post with further suggestions on debugging a script.


    Enable TraceOrders, print the time of the bar and all values used in the conditions that submit entry orders. Include labels for all values and comparison operators.

    Let me know if you need any assistance creating a print or enabling TraceOrders.

    Save the output from the output window to a text file and provide this with your reply.

    I'll be happy to assist with analyzing the output.​

    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