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 MohammedAmine, Today, 10:44 AM
    1 response
    5 views
    0 likes
    Last Post NinjaTrader_Kate  
    Started by Nolyn, Today, 10:59 AM
    1 response
    7 views
    0 likes
    Last Post NinjaTrader_BrandonH  
    Started by Gkomi, Today, 10:02 AM
    1 response
    6 views
    0 likes
    Last Post NinjaTrader_Jim  
    Started by JTizz, Today, 08:58 AM
    7 responses
    32 views
    0 likes
    Last Post JTizz
    by JTizz
     
    Started by Bob49, Today, 08:40 AM
    0 responses
    22 views
    0 likes
    Last Post Bob49
    by Bob49
     
    Working...
    X