Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Print Order details

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

    Print Order details

    Hello Team,

    I would like to print the order details in unmanaged approch. I do have setstoploss() and setprofittarget() in my stratergy, If i need to see order details, i can do print in onOrderupdate() function?

    ​protected override void OnOrderUpdate(Order order, double limitPrice, double stopPrice, int quantity, int filled, double averageFillPrice, OrderState orderState, DateTime time, ErrorCode error, string comment)
    {
    Print("order Name is" + order.Name);
    }​



    I am getting error" Class member deleration expected".​

    #2
    Hello jenishij,

    Thank you for your post.

    SetStopLoss() and SetProfitTarget() are order methods only available for strategies using the Managed Approach:In the Unmanaged Approach, you could use SubmitOrderUnmanaged() to create your own protective stop loss and profit target orders, and you may even use an OCO ID to tie them together as one cancels other orders:You could use OnOrderUpdate() and OnExecutionUpdate() to submit your protective orders, similarly to what is demonstrated in this sample script:For an example using orders tied together via OCO in an unmanaged strategy, my colleague posted an unmanaged OCO bracket example found here:I am not sure of what might be causing the error message "Class member declaration expected." You will need to look further into the error details, such as the line number causing the error, in order to narrow down the cause and determine a solution.

    Please let us know if we may be of further assistance.

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by CarlTrading, 03-31-2026, 09:41 PM
    1 response
    45 views
    0 likes
    Last Post NinjaTrader_ChelseaB  
    Started by CarlTrading, 04-01-2026, 02:41 AM
    0 responses
    21 views
    0 likes
    Last Post CarlTrading  
    Started by CaptainJack, 03-31-2026, 11:44 PM
    0 responses
    31 views
    1 like
    Last Post CaptainJack  
    Started by CarlTrading, 03-30-2026, 11:51 AM
    0 responses
    50 views
    0 likes
    Last Post CarlTrading  
    Started by CarlTrading, 03-30-2026, 11:48 AM
    0 responses
    42 views
    0 likes
    Last Post CarlTrading  
    Working...
    X