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

CrossBelow CrossAbove with Fixed Price

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

    CrossBelow CrossAbove with Fixed Price

    Seems simple but can't wrap my head around it. I would like to use CrossBelow and CrossAbove with a fixed price. Let me explain.

    *** when the market is above my target price ***
    if market crosses below my fixed price of 3200, then go long

    Notes: Because the market is above my target price, I would like to use the Low[0] like so:
    if (CrossBelow(Low[0], 3200, 1))
    EnterLong();


    *** when the market is below my target price ***
    if market crosses above my fixed price of 3200, then go short

    Notes: Because the market is below my target price, I would like to use the High[0] like so:
    if (CrossBelow(High[0], 3200, 1))
    EnterShort();

    Any ideas of how i can use a fixed price like 3200 in CrossBelow / CrossAbove? Or is there a better way?

    Thanks,

    Last edited by bc24fl; 01-25-2021, 02:53 PM.

    #2
    Hello bc24fl,

    Thank you for your post.

    You could use the Strategy Builder to create cross above/cross below conditions followed by setting an action of enter long or short. Please see the help guide documentation and the publicly available video linked below for more information.

    Create crossover conditions - https://ninjatrader.com/support/help...sOverCondition
    Strategy Builder 301 -https://www.youtube.com/watch?v=VxU4FR6GWNA

    Also, please see the attached example that demonstrates this.

    Let us know if we may assist further.
    Attached Files
    Brandon H.NinjaTrader Customer Service

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by kevinenergy, 02-17-2023, 12:42 PM
    118 responses
    2,778 views
    1 like
    Last Post kevinenergy  
    Started by briansaul, Today, 05:31 AM
    0 responses
    9 views
    0 likes
    Last Post briansaul  
    Started by traderqz, Yesterday, 12:06 AM
    11 responses
    28 views
    0 likes
    Last Post NinjaTrader_Gaby  
    Started by PaulMohn, Today, 03:49 AM
    0 responses
    9 views
    0 likes
    Last Post PaulMohn  
    Started by inanazsocial, Today, 01:15 AM
    1 response
    12 views
    0 likes
    Last Post NinjaTrader_Jason  
    Working...
    X