How to open 2 oposite stop orders?
Use date expiration parameter in OrderSend().
| Parameters:
|
|---|
Something like this:
if okToBuy=true
{
here i would like to have my long stop pending order
}
if okToSell=true
{
here i would like to have my short stop pending order
}
Also if a new candle opens and the orders have not been triggered i would like them to imediately get canceled because on this candle i might need to issue 2 new orders at a different price.
I would be very greatful if someone could show me an example of how the code should be structured in order for me to achieve that.