Cannot call OrderSend inside an indicator.
Biertago:
Trading functions don't work from Indicators . . . only from Scripts and EAs. Please read the documentation: Trading Functions "Trading functions can be used in experts and scripts."
I've got an indicator that signals an action by sound and alert:
I wanted to add there the OrderSend function to auto buy-sell and it looks this way:
When the time comes, there is the signal, there is the alert but there are no orders.
Any ideas what is wrong?
Okay, I see, is there any way I can make it work? Can I call a script from the indicator?
No. Indicators do not call anything. They indicate.
Write a script or EA. Get the indicators values via iCustom and when the condition is correct open.
I've got an indicator that signals an action by sound and alert:
I wanted to add there the OrderSend function to auto buy-sell and it looks this way:
When the time comes, there is the signal, there is the alert but there are no orders.
Any ideas what is wrong?