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

Build a Strategy to exit a position..

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

    Build a Strategy to exit a position..

    Hello,

    I'm Using Strategy Builder to try and build an auomated setup...

    How do you exit a long posiiton to take profit and re-enter the market long again..??

    As an example.. In an uptrend, I have a cross over setup using thresholds where I want to exit a long position where it ends, take profit, (before the line crosses over to go short), and then wait for the next signal to re-enter the market on the next long again..I can't get the logic correct.. I know can use a profit target and a stop, but I'm curious on how to get the logic correct..


    Thanks Michael


    #2
    Hello Mykro,

    Thanks for your inquiry.

    If you are looking to have the strategy exit from a crossover, I suggest using the Conditions and Actions tab to configure logic that:
    • Checks if you are in a long position
    • Checks if your cross has occurred
    • Calls ExitLong to exit the position
    If you want to set a profit target for this Long Position, you can use the Targets and Stops tab and set a profit target and tie it to your long position by having the SetProfitTarget "fromEntrySignal" match the "Signal Name" for your entry.

    I would then suggest designing the Entry logic so you enter a position when:
    • The Strategy's position is flat
    • Criteria has been met for your Long entry
    The logic would then exit your positions with logic specific to going long, and your entry logic will only be used when the position is flat.

    I also suggest starting with a simple example to observe the logic is working, and then to scale up with additional logic. I have attached an example that can be tested on your end.

    Educational resources for using the Strategy Builder are linked below.

    Strategy Builder 301 - https://www.youtube.com/watch?v=_KQF2Sv27oE
    Conditions exmaples - https://ninjatrader.com/support/help...on_builder.htm
    Actions examples - https://ninjatrader.com/support/help...us/actions.htm

    Please let us know if we can be of further assistance.
    Attached Files
    JimNinjaTrader Customer Service

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by AttiM, 02-14-2024, 05:20 PM
    12 responses
    212 views
    0 likes
    Last Post DrakeiJosh  
    Started by cre8able, 02-11-2023, 05:43 PM
    3 responses
    237 views
    0 likes
    Last Post rhubear
    by rhubear
     
    Started by frslvr, 04-11-2024, 07:26 AM
    8 responses
    116 views
    1 like
    Last Post NinjaTrader_BrandonH  
    Started by stafe, 04-15-2024, 08:34 PM
    10 responses
    47 views
    0 likes
    Last Post stafe
    by stafe
     
    Started by rocketman7, Today, 09:41 AM
    3 responses
    11 views
    0 likes
    Last Post NinjaTrader_Jesse  
    Working...
    X