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

How to set conditional to sell on all time high?

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

    How to set conditional to sell on all time high?

    I want to tell the strategy builder to sell all open orders at the stock's all time high or my indicator's all time high. I don't know how to set this. I already have the buy conditions solid.
    Note: I only use the built in strategy builder, not the programming side. Also, I have the free version with day to day information.

    Ideally I would want to say: if the price breaks the highest value within 240 bars, sell current position.
    Screenshot added for example.

    #2
    Hello shamwow,

    The all time high would mean running through all of the data for the instrument.

    You could have a double variable that is compared to the high of the current bar, and if the current bar is higher, then the variable is to the current bar.

    The MAX() would also let you find the highest high in a certain amount of bars.

    The 52 week high is fundamental data (that can be accessed from code, but not in the strategy builder)

    Below is a link to a forum post with helpful information about getting started with NinjaScript and C#. Be sure to watch the Strategy Builder 301 video linked in the post.
    Chelsea B.NinjaTrader Customer Service

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by Waxavi, Today, 02:10 AM
    1 response
    16 views
    0 likes
    Last Post NinjaTrader_LuisH  
    Started by Kaledus, Today, 01:29 PM
    5 responses
    13 views
    0 likes
    Last Post NinjaTrader_Jesse  
    Started by Waxavi, Today, 02:00 AM
    1 response
    12 views
    0 likes
    Last Post NinjaTrader_LuisH  
    Started by alifarahani, Today, 09:40 AM
    5 responses
    23 views
    0 likes
    Last Post NinjaTrader_Jesse  
    Started by gentlebenthebear, Today, 01:30 AM
    3 responses
    17 views
    0 likes
    Last Post NinjaTrader_Jesse  
    Working...
    X