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

Reversing positions vs Closing

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

    Reversing positions vs Closing

    I just ran into this today and was wondering what the best supported method/setting is for having strategies reverse positions rather than close when running a short and long strategy simultaneously?

    For example: Today my short strategy entered a position, a few bars later my long strategy attempted to take a position but actually ended up closing the short position and leaving my account flat.
    As a secondary issue, since the short strategy was closed, but not by the coded method (X number of bars since entry = close position), when the bars since entry condition occurred, instead of closing a short position with a buy order, it ended up opening a long position.

    These strategies were built in strategy builder and run on different time frames - so I have two enabled strategies in the strategy tab.

    Thanks!

    #2
    Hello MisterGee,

    Thanks for your post.

    You cannot be long and short at the same time on the same account. In order to be long and short at the same time, you will need to trade with two separate accounts. If you consult your broker, you could ask to open a linked account so you can have 2 accounts to trade with when you connect with your login credentials in NinjaTrader.

    Also keep in mind, strategies run independently of the account. (Strategy Positions and Account Positions are separate.) A strategy running on one account/instrument should be the only thing placing trades to that account/instrument, otherwise the strategy and account will fall out of sync. In your case, one strategy submitted a buy order which closed the short position on the account. The strategy which was short has no knowledge of trades submitted to the account, and is then out of sync.

    It is possible to program strategies to monitor account positions with PositionAccount, but you would also want to consider an Unmanaged Approach where the strategy does not use Exit methods which are tied to the internal strategy position.

    To move forward, I suggest considering linked accounts from your broker to go long and short at the same time.

    Please also review our Strategy vs. Account Position documentation for more details - https://ninjatrader.com/support/help..._account_p.htm

    We look forward to assisting.
    JimNinjaTrader Customer Service

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by arvidvanstaey, Today, 02:19 PM
    2 responses
    6 views
    0 likes
    Last Post arvidvanstaey  
    Started by jordanq2, Today, 03:10 PM
    0 responses
    2 views
    0 likes
    Last Post jordanq2  
    Started by traderqz, Today, 12:06 AM
    10 responses
    18 views
    0 likes
    Last Post traderqz  
    Started by algospoke, 04-17-2024, 06:40 PM
    5 responses
    46 views
    0 likes
    Last Post NinjaTrader_Jesse  
    Started by mmckinnm, Today, 01:34 PM
    3 responses
    6 views
    0 likes
    Last Post NinjaTrader_ChelseaB  
    Working...
    X