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 NichUK, Today, 10:51 AM
    0 responses
    7 views
    0 likes
    Last Post NichUK
    by NichUK
     
    Started by caseymour127, Today, 09:46 AM
    2 responses
    20 views
    0 likes
    Last Post caseymour127  
    Started by Apo84, Today, 09:37 AM
    1 response
    20 views
    0 likes
    Last Post NinjaTrader_ChrisL  
    Started by skblack1911, Today, 09:41 AM
    1 response
    3 views
    0 likes
    Last Post NinjaTrader_RyanS  
    Started by bedaine, Today, 09:40 AM
    3 responses
    16 views
    0 likes
    Last Post NinjaTrader_RyanS  
    Working...
    X