Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

REVERSE BUY SELL to SELL BUY

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

    REVERSE BUY SELL to SELL BUY

    where can I find script whom I want to sell to buy MARKET, and from whom I buy to sell MARKET ?


    SCRIPT TO REVERSE A PLACED ORDER
    Thank you
    Last edited by SaVior; 07-18-2014, 08:28 AM.

    #2
    Hi SaVior,

    Thank you for your post.

    Just to clarify are you looking for a NinjaScript Strategy that will reverse a manual order you have placed with an order window?

    If so, I am not aware of any script that does this. It is not supported to detect orders made from outside of the running strategy's instance so I am not able to assist with this. However, this is possible to do.

    As a tip to get you started, below is a short piece of code that demonstrates how to find orders for all accounts and print them to the output window.

    Code:
    foreach (Account acct in Cbi.Globals.Accounts)
    {
    if (acct.Positions != null)
    {
    // print information about each position
    PositionCollection positions = acct.Positions;
    foreach (Position pos in positions)
    {
    Print(pos.Account.Name + " " + pos.Instrument + " " + pos.MarketPosition + " " + pos.Quantity + " " + pos.AvgPrice);
    }
    // print information about each order
    OrderCollection orders = acct.Orders;
    foreach (Order ord in orders)
    {
    Print(ord.ToString());
    }
    }
    Chelsea B.NinjaTrader Customer Service

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by charlesugo_1, 05-26-2026, 05:03 PM
    0 responses
    49 views
    0 likes
    Last Post charlesugo_1  
    Started by DannyP96, 05-18-2026, 02:38 PM
    1 response
    141 views
    0 likes
    Last Post NinjaTrader_ChelseaB  
    Started by CarlTrading, 05-11-2026, 05:56 AM
    0 responses
    160 views
    0 likes
    Last Post CarlTrading  
    Started by CarlTrading, 05-10-2026, 08:12 PM
    0 responses
    96 views
    0 likes
    Last Post CarlTrading  
    Started by Hwop38, 05-04-2026, 07:02 PM
    0 responses
    275 views
    0 likes
    Last Post Hwop38
    by Hwop38
     
    Working...
    X