Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

NinjaScript Strategy: Independent Orders

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

  • bltdavid
    replied
    Originally posted by engrvivs View Post
    I mean for the same account, any long should close previously opened short position and vice-versa; but it didn't happen in the afore-mentioned case of two separate NS strategies. What is the reason of such behavior?
    Did you read that link about strategy position vs account position?

    Study it carefully. It said:
    "A Strategy Position is a virtual position that is created by the entry and exit executions generated by a strategy and is independent from any other running strategy’s position or an Account Position."

    Thus, as Sledge said, NT keeps them separate.

    The buys/sells of one strategy are unknown by all other running strategies. This is just the way NT designed it -- it probably removed some very serious complexity in the early stages of development. If NT were to change this now, I'm sure it would be a very complex solution and would require extensive non-trivial code changes.

    The point is: if all strategies are trading inside the same account, obviously your broker sees all buys & sells.

    Leave a comment:


  • koganam
    replied
    Originally posted by engrvivs View Post
    Thanks bltdavid for your comments!

    Yet, now I have another question.

    I copied same strategy's logic as two separate NS strategies. In one, I allowed only Buy orders to be placed, while in another I allowed placed only SellShort orders.
    On applying these two strategies, simultaneously, on the same chart (instrument), I was able to achieve desired behavior of ensuring co-existence of Buy and SellShort orders.

    But how is this achieved, if from "broker's point of view, going short is no different than a sell. Covering a short is no different than a buy"?

    I mean for the same account, any long should close previously opened short position and vice-versa; but it didn't happen in the afore-mentioned case of two separate NS strategies. What is the reason of such behavior?

    Kind Regards
    Vivek
    Already discussed a few times. Here is one such.

    ref: http://ninjatrader.com/support/forum...d.php?p=303022

    Leave a comment:


  • bltdavid
    replied
    Originally posted by engrvivs View Post
    Still, I will happy if there can be more pointers in the direction to independently handle opposite orders.
    Use 2 different accounts with the same broker.

    Run strat for LONG entires in acct A on chart #1.
    Run strat for SHORT entries in acct B on chart #2.

    You don't need a multi-broker license.
    Acct A is always for longs.
    Acct B is always for shorts.

    Problem solved.
    Last edited by bltdavid; 06-17-2016, 10:32 AM.

    Leave a comment:


  • engrvivs
    replied
    Thanks alot sledge for your comments!

    They have been very useful!

    Still, I will happy if there can be more pointers in the direction to independently handle opposite orders.

    Leave a comment:


  • sledge
    replied
    Originally posted by engrvivs View Post
    Is there any way to circumvent such scenario, ensuring open opposite orders?

    I'm accustomed to MetaTrade 4 order management style and have been trying to emulate MT4 style in NT.

    Thanks
    I've never used MT4 and have probably never seen it.... so honestly I have no idea.

    Maybe they were keeping it separate in the one window but your broker was "flat".

    I haven't tried to run 2 strategies on same instrument in same chart that can be opposing entries in NT.

    Leave a comment:


  • engrvivs
    replied
    Is there any way to circumvent such scenario, ensuring open opposite orders?

    I'm accustomed to MetaTrade 4 order management style and have been trying to emulate MT4 style in NT.

    Thanks
    Last edited by engrvivs; 06-16-2016, 11:25 PM.

    Leave a comment:


  • sledge
    replied
    [QUOTE=engrvivs;464065]Are the orders actually open in such scenario
    or
    there is no order open at broker's end?[/QUOTE]

    You would be FLAT. No orders.

    Leave a comment:


  • engrvivs
    replied
    Originally posted by sledge View Post
    NT keeps it separate.

    If you are +2 in one NT window and -2 in another NT window - you are 0 at your broker.
    Are the orders actually open in such scenario
    or
    there is no order open at broker's end?

    Leave a comment:


  • sledge
    replied
    Originally posted by engrvivs View Post
    Thanks bltdavid for your comments!

    Yet, now I have another question.

    I copied same strategy's logic as two separate NS strategies. In one, I allowed only Buy orders to be placed, while in another I allowed placed only SellShort orders.
    On applying these two strategies, simultaneously, on the same chart (instrument), I was able to achieve desired behavior of ensuring co-existence of Buy and SellShort orders.

    But how is this achieved, if from "broker's point of view, going short is no different than a sell. Covering a short is no different than a buy"?

    I mean for the same account, any long should close previously opened short position and vice-versa; but it didn't happen in the afore-mentioned case of two separate NS strategies. What is the reason of such behavior?

    Kind Regards
    Vivek
    NT keeps it separate.

    If you are +2 in one NT window and -2 in another NT window - you are 0 at your broker.

    Leave a comment:


  • engrvivs
    replied
    Thanks bltdavid for your comments!

    Yet, now I have another question.

    I copied same strategy's logic as two separate NS strategies. In one, I allowed only Buy orders to be placed, while in another I allowed placed only SellShort orders.
    On applying these two strategies, simultaneously, on the same chart (instrument), I was able to achieve desired behavior of ensuring co-existence of Buy and SellShort orders.

    But how is this achieved, if from "broker's point of view, going short is no different than a sell. Covering a short is no different than a buy"?

    I mean for the same account, any long should close previously opened short position and vice-versa; but it didn't happen in the afore-mentioned case of two separate NS strategies. What is the reason of such behavior?

    Kind Regards
    Vivek

    Leave a comment:


  • bltdavid
    replied
    Originally posted by engrvivs View Post
    I thought unless a Sell order be placed, the previously filled (and open) Buy order won't close.
    Similarly, BuyToCover closing an open SellShort order.

    Yet, thanks for clarifying that any opposite order will close previously opened opposite position.
    This sounds like a perfect opportunity to plug this:


    From your broker's point of view, going short is no different than a sell. Covering a short is no different than a buy.

    [Edit: I am assuming futures here, not stocks]

    For ex:
    ES Buy LONG 3 -- you are now LONG 3 at your broker
    ES Sell SHORT 3 -- you are now FLAT at your broker

    Managed vs Unmanaged has nothing to do with it.

    Leave a comment:


  • engrvivs
    replied
    Thanks Paul for clarification!

    I thought unless a Sell order be placed, the previously filled (and open) Buy order won't close.
    Similarly, BuyToCover closing an open SellShort order.

    Yet, thanks for clarifying that any opposite order will close previously opened opposite position.

    Kind Regards
    Vivek

    Leave a comment:


  • NinjaTrader_PaulH
    replied
    Hello Vivek,

    Thanks for your post.

    You cannot fill an order opposing a position and expect it not to affect it.

    Leave a comment:


  • engrvivs
    started a topic NinjaScript Strategy: Independent Orders

    NinjaScript Strategy: Independent Orders

    Hi

    Is it possible code a NinjaScript Strategy (unmanaged orders) in such a way that placing a SellShort order doesn't close a previously filled (and open) Buy order, and vice-versa?

    Kind Regards
    Vivek

Latest Posts

Collapse

Topics Statistics Last Post
Started by Geovanny Suaza, 02-11-2026, 06:32 PM
0 responses
656 views
0 likes
Last Post Geovanny Suaza  
Started by Geovanny Suaza, 02-11-2026, 05:51 PM
0 responses
371 views
1 like
Last Post Geovanny Suaza  
Started by Mindset, 02-09-2026, 11:44 AM
0 responses
109 views
0 likes
Last Post Mindset
by Mindset
 
Started by Geovanny Suaza, 02-02-2026, 12:30 PM
0 responses
574 views
1 like
Last Post Geovanny Suaza  
Started by RFrosty, 01-28-2026, 06:49 PM
0 responses
579 views
1 like
Last Post RFrosty
by RFrosty
 
Working...
X