I'd appreciate if someone could help me. Instead of using market orders with the stop loss and take profit internally coded in my EA, I want to try with pending orders with the stop loss and take profit embedded in them. The thing is that the OrderSend() function draws an arrow when the order is opened, but it doesn't draw anything where the stop or the take profit are executed, nor draws the line that links order open and close points. Is there a simple way to draw both the closing arrow and the connector line after the stoploss and takeprofit?
Thank you!
This is how I would do it: (not sure how correct it would be)
I'm not 100% sure what you're asking for; but try write a for loop that picks up when order closes at stop or t.p then use object create for the EA to draw the arrow at that price/ time. Or alternatively, if I have misunderstood what you are asking, my apologies.
Buystop's are never closed; they are only deleted or become buy orders.
This is how I would do it: (not sure how correct it would be)
I'm not 100% sure what you're asking for; but try write a for loop that picks up when order closes at stop or t.p then use object create for the EA to draw the arrow at that price/ time. Or alternatively, if I have misunderstood what you are asking, my apologies.
Yes, you're right. I meant an order sent as a buystop, that became buy order, and then was closed by the TP or the STYes, you understood well. Thank you for the help. I was wondering if there was a more straightforward way to do it, and now I guess there isn't so I will have to use the ObjectCreate()
Hi,
Did you manage to complete the task with the Object Create() function?
|
I'd appreciate if someone could help me. Instead of using market orders with the stop loss and take profit internally coded in my EA, I want to try with pending orders with the stop loss and take profit embedded in them. The thing is that the OrderSend() function draws an arrow when the order is opened, but it doesn't draw anything where the stop or the take profit are executed, nor draws the line that links order open and close points. Is there a simple way to draw both the closing arrow and the connector line after the stoploss and takeprofit?
Thank you!
I think your broker does not allow us to set SL and/or TP value in OrderSend function. If so, then we should let SL/TP value to 0 and add OrderModify function to set SL/TP value.
(just aware that this thread is old)
|

- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
I'd appreciate if someone could help me. Instead of using market orders with the stop loss and take profit internally coded in my EA, I want to try with pending orders with the stop loss and take profit embedded in them. The thing is that the OrderSend() function draws an arrow when the order is opened, but it doesn't draw anything where the stop or the take profit are executed, nor draws the line that links order open and close points. Is there a simple way to draw both the closing arrow and the connector line after the stoploss and takeprofit?
Thank you!