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 Mindset, 04-21-2026, 06:46 AM
    0 responses
    88 views
    0 likes
    Last Post Mindset
    by Mindset
     
    Started by M4ndoo, 04-20-2026, 05:21 PM
    0 responses
    135 views
    0 likes
    Last Post M4ndoo
    by M4ndoo
     
    Started by M4ndoo, 04-19-2026, 05:54 PM
    0 responses
    68 views
    0 likes
    Last Post M4ndoo
    by M4ndoo
     
    Started by cmoran13, 04-16-2026, 01:02 PM
    0 responses
    119 views
    0 likes
    Last Post cmoran13  
    Started by PaulMohn, 04-10-2026, 11:11 AM
    0 responses
    69 views
    0 likes
    Last Post PaulMohn  
    Working...
    X