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 judysamnt7, 03-13-2023, 09:11 AM
    4 responses
    59 views
    0 likes
    Last Post DynamicTest  
    Started by ScottWalsh, Today, 06:52 PM
    4 responses
    36 views
    0 likes
    Last Post ScottWalsh  
    Started by olisav57, Today, 07:39 PM
    0 responses
    7 views
    0 likes
    Last Post olisav57  
    Started by trilliantrader, Today, 03:01 PM
    2 responses
    21 views
    0 likes
    Last Post helpwanted  
    Started by cre8able, Today, 07:24 PM
    0 responses
    10 views
    0 likes
    Last Post cre8able  
    Working...
    X