Announcement

Collapse

Looking for a User App or Add-On built by the NinjaTrader community?

Visit NinjaTrader EcoSystem and our free User App Share!

Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
See more
See less

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 rbeckmann05, Yesterday, 06:48 PM
    1 response
    12 views
    0 likes
    Last Post bltdavid  
    Started by llanqui, Today, 03:53 AM
    0 responses
    6 views
    0 likes
    Last Post llanqui
    by llanqui
     
    Started by burtoninlondon, Today, 12:38 AM
    0 responses
    10 views
    0 likes
    Last Post burtoninlondon  
    Started by AaronKoRn, Yesterday, 09:49 PM
    0 responses
    15 views
    0 likes
    Last Post AaronKoRn  
    Started by carnitron, Yesterday, 08:42 PM
    0 responses
    11 views
    0 likes
    Last Post carnitron  
    Working...
    X