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

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

    Strategy Builder

    Hello
    Is there away or condition to make a strategy take Long position then only Take short position after and not take two consecutive positions on same type ?

    I appreciate your help and efforts

    Thank you

    #2
    Hello bofygym7, thanks for writing in.

    In the strategy builder, you can check the current market position of the strategy. You can also add a boolean variable to the script in the Inputs and variables section and add it in as a part of the trade condition so that it only triggers once. e.g.

    if(MyBoolean && <conditions to trade>)
    {
    //go long
    MyBoolean = false; // set to false, then reset to true when ready to go long again
    }

    How exactly you add it depends on the entry conditions of your strategy/ how your strategy is designed. Please see this example we have on checking the market position:

    https://ninjatrader.com/support/help...ionComparisons

    Kind regards,
    -ChrisL
    Chris L.NinjaTrader Customer Service

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by kempotrader, Today, 08:56 AM
    0 responses
    6 views
    0 likes
    Last Post kempotrader  
    Started by kempotrader, Today, 08:54 AM
    0 responses
    4 views
    0 likes
    Last Post kempotrader  
    Started by mmenigma, Today, 08:54 AM
    0 responses
    2 views
    0 likes
    Last Post mmenigma  
    Started by halgo_boulder, Today, 08:44 AM
    0 responses
    1 view
    0 likes
    Last Post halgo_boulder  
    Started by drewski1980, Today, 08:24 AM
    0 responses
    3 views
    0 likes
    Last Post drewski1980  
    Working...
    X