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 GwFutures1988, Today, 02:48 PM
    0 responses
    2 views
    0 likes
    Last Post GwFutures1988  
    Started by mmenigma, Today, 02:22 PM
    1 response
    3 views
    0 likes
    Last Post NinjaTrader_Jesse  
    Started by frankthearm, Today, 09:08 AM
    9 responses
    35 views
    0 likes
    Last Post NinjaTrader_Clayton  
    Started by NRITV, Today, 01:15 PM
    2 responses
    9 views
    0 likes
    Last Post NRITV
    by NRITV
     
    Started by maybeimnotrader, Yesterday, 05:46 PM
    5 responses
    28 views
    0 likes
    Last Post NinjaTrader_ChelseaB  
    Working...
    X