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

If Strategy has No Exits built in how does strategy Know when is it flat

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

    If Strategy has No Exits built in how does strategy Know when is it flat

    If Strategy has No Exits built in how does strategy Know when is it flat

    Building Strategy to Enter Positions Only. I wish to manage exits with manual input. How will the strategy know when the position no longer exsist so that it might enter another position

    #2
    Hello DTSSTS,

    Thanks for your post.

    If the strategy has no exits, including exit on session, then it (the strategy) would never be flat once its entry order is filled.

    Strategies are intended to be run automatically without user interaction. For example, if a strategy has a long position and you manually place a short position on the same instrument and same account the account position would then be flat however the strategy position would continue to be long until the strategy itself closes the long position. You can test this yourself by creating a strategy that only places 1 order and does not have exit on session close set and Print the value of Position.MarketPosition. Once the entry order is filled you would see the output window showing the strategy position. If you then manually place an opposite order, once it fills the strategy position will continue to be as it was but the account position will be flat.

    While strategies are intended to run without manual interactions you can create a strategy that does work with ATMs which does allow you to then directly manipulate the ATM profit/stops as you wish and the strategy will remain in sync with the account position. This type of strategy uses special ninjascript method/properties but does not work with strategy builder type strategies. In your Ninjatrader is the strategy SampleAtmStrategy that is well documented in its code and demonstrates the usage. The strategy will find/place a long entry and then control is turned over to the ATM for the stop/profit targets. Once the profit or stop are filled, the strategy then finds and places the next order. Here is a link to the strategy ATM methods in the help guide: https://ninjatrader.com/support/help...gy_methods.htm

    If you would like a strategy like that created for you, using your entry criteria, we can provide link(s) to 3rd party programmers who can provide that coding service.


    Paul H.NinjaTrader Customer Service

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by bortz, 11-06-2023, 08:04 AM
    47 responses
    1,602 views
    0 likes
    Last Post aligator  
    Started by jaybedreamin, Today, 05:56 PM
    0 responses
    8 views
    0 likes
    Last Post jaybedreamin  
    Started by DJ888, 04-16-2024, 06:09 PM
    6 responses
    18 views
    0 likes
    Last Post DJ888
    by DJ888
     
    Started by Jon17, Today, 04:33 PM
    0 responses
    4 views
    0 likes
    Last Post Jon17
    by Jon17
     
    Started by Javierw.ok, Today, 04:12 PM
    0 responses
    12 views
    0 likes
    Last Post Javierw.ok  
    Working...
    X