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 ezrollin, Yesterday, 11:26 PM
    1 response
    40 views
    0 likes
    Last Post NinjaTrader_PaulH  
    Started by ezrollin, Yesterday, 09:10 PM
    1 response
    52 views
    0 likes
    Last Post NinjaTrader_PaulH  
    Started by traderhawk, Today, 05:53 AM
    0 responses
    13 views
    0 likes
    Last Post traderhawk  
    Started by Angus7, Today, 04:31 AM
    8 responses
    51 views
    0 likes
    Last Post Angus7
    by Angus7
     
    Started by aligator, Yesterday, 11:24 PM
    0 responses
    43 views
    0 likes
    Last Post aligator  
    Working...
    X