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 NullPointStrategies, 03-13-2026, 05:17 AM
    0 responses
    95 views
    0 likes
    Last Post NullPointStrategies  
    Started by argusthome, 03-08-2026, 10:06 AM
    0 responses
    153 views
    0 likes
    Last Post argusthome  
    Started by NabilKhattabi, 03-06-2026, 11:18 AM
    0 responses
    80 views
    0 likes
    Last Post NabilKhattabi  
    Started by Deep42, 03-06-2026, 12:28 AM
    0 responses
    54 views
    0 likes
    Last Post Deep42
    by Deep42
     
    Started by TheRealMorford, 03-05-2026, 06:15 PM
    0 responses
    70 views
    0 likes
    Last Post TheRealMorford  
    Working...
    X