Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Strategy Builder Use of Updating Variables

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

    Strategy Builder Use of Updating Variables

    I have some strategy ideas that involve storing values in variables, I have encountered the occasional logic bug that I cant figure out, and I am wondering if what I am trying to do is even possible on strategy builder. I am hoping to use strategy builder for all of this because I spend more time fighting syntax errors when coding than actually creating and testing strategies.

    As an example of the type of operation I am trying to do, lets use an ATR based profit target as an example. I would like to update the value of ATR and store it in a variable at the end of every bar ATRval, then I will create an input that is called profitTargetMultiplier and set that equal to 2 for example. I then would like to use the arithmetic widget to set the a profitGoalAmount variable which then could be added into a current position average price when creating a limit order to exit. Is there any reason why something like this would not work on strategy builder? Also what would be the best way to go about organizing the condition sets so that they are updating reliably? Cheers, thanks for any input! I am sure this will be the first of many discussions on here!

    #2
    Hello BoneM4nwalkin,

    Welcome to the NinjaTrader forums!

    Saving the value of an indicator to a variable is possible. Doing math however, would require using a custom Series in the Strategy Builder or unlocking the script (for example you can use the offset to multiply by 2).
    with regard to the attached image: Line A is an indicator Line B is the m period MAX of line A Line C is an average of this indicator A Line D is another average of this indicator A is it possible, possibly using the strategy builder, but without adding a temporary variable, to set on the condition: line C crosses below line D


    The conditions are evaluated individually and in order. These should be organized in the order that each condition and action should be checked and triggered.
    Chelsea B.NinjaTrader Customer Service

    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