How can I create order in an indicator?
Created at 18 Jan 2021, 16:09
How can I create order in an indicator?
18 Jan 2021, 16:09
I want to call the PlaceStopOrder and ExecuteMarketOrder in an indicator, can I do that?
I know I should use these in a cBot, but my indicator just like a tool to setup the risk/reward and find the stop loss and take profit value, so I want to create the order within the indicator, I also try to do these with a cBot and it works fine, but I just find that can't sync the symbols in different windows when I was using the cBot:
that's why I want to use an indicator, any ideas?
thanks!
JerryTrader
05 Feb 2021, 20:16
You can't.
Indicators are just made to draw things on charts, but don't have any access to your account, nor orders, positions, etc...
Your indicator could write its calculated stop loss / take profit to a file or in registry.
Then you create a cBot that listens to this file or registry change, reads the values, and create orders accordingly.
@JerryTrader