Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Private Variable not updateing

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

    Private Variable not updateing

    Hello All-

    Please see the attached screenshot for reference.

    I have a strategy that will take will take a trade long if the conditions in Set 1 are met. Then the idea was that I follow the example in BreakEvenBuilderExample that was on the forums to create custom trailing stop/breakeven stops.

    The issue I am having is that when I run the strategy and my conditions are met, the strategy takes the trade long as it should but the variable I created, FifteenStopState that sets different stops or limits as the trade progresses, doesn't update to 1.

    As you can see I added code to plot the status of FifteenStopState to see what is happening. The dot is Blue the whole time, meaning FifteenStopState is 0. It should plot Red when I enter a trade, meaning FifteenStopState is 1.

    What am I missing? How can the strategy execute the Limit Order but not set the FifteenStopState to 1 if they both use the exact same conditions in Set 1?

    I hope its something obvious I am missing. Let me know if you need more information.

    Thank you,

    Nick
    Attached Files

    #2
    Hello Nick,

    If the assignment is not happening, this likely means that the condition is not evaluating as true.

    In a new set print all of the values you are using in the condition along with the time. This will let you know for each bar if the condition is true or false.

    Below is a link to a forum post with a video that demonstrates adding prints to debug in the Strategy Builder.
    Chelsea B.NinjaTrader Customer Service

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by Mindset, 04-21-2026, 06:46 AM
    0 responses
    90 views
    0 likes
    Last Post Mindset
    by Mindset
     
    Started by M4ndoo, 04-20-2026, 05:21 PM
    0 responses
    137 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
    120 views
    0 likes
    Last Post cmoran13  
    Started by PaulMohn, 04-10-2026, 11:11 AM
    0 responses
    71 views
    0 likes
    Last Post PaulMohn  
    Working...
    X