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 geddyisodin, Today, 05:20 AM
    3 responses
    20 views
    0 likes
    Last Post NinjaTrader_Gaby  
    Started by lorem, Today, 09:18 AM
    1 response
    4 views
    0 likes
    Last Post lorem
    by lorem
     
    Started by bmartz, Today, 09:30 AM
    0 responses
    3 views
    0 likes
    Last Post bmartz
    by bmartz
     
    Started by GussJ, 03-04-2020, 03:11 PM
    14 responses
    3,245 views
    0 likes
    Last Post GussJ
    by GussJ
     
    Started by ArkansasClint, Today, 09:28 AM
    0 responses
    2 views
    0 likes
    Last Post ArkansasClint  
    Working...
    X