How to start with MQL5 - page 22

 
How can i use an indicator value to close a trade ? I want to use an EMA 8 as take profit level and the trade to automatically close when bid/ask is equal to EMA 8 value 
 
GeorgeReji:
How can i use an indicator value to close a trade ? I want to use an EMA 8 as take profit level and the trade to automatically close when bid/ask is equal to EMA 8 value 
You have definitely not confused Stop Loss and Take Profit?  If you show a picture, it will help me a lot.
 
Vladimir Karputov:
You have definitely not confused Stop Loss and Take Profit?  If you show a picture, it will help me a lot.
The buy or sell order will be opened when the price crosses a bollinger band, i want to close the trade at the EMA level. Sorry for confusing you
 
GeorgeReji:
The buy or sell order will be opened when the price crosses a bollinger band, i want to close the trade at the EMA level. Sorry for confusing you
The algorithm is as follows: the Expert Advisor creates an indicator handle (this is done in OnInit).  Then, using CopyByffer, we get the indicator data.  With CopyRates we get OHLC.  Let's compare the data of the indicator and OHLC.
 
Vladimir Karputov:
The algorithm is as follows: the Expert Advisor creates an indicator handle (this is done in OnInit).  Then, using CopyByffer, we get the indicator data.  With CopyRates we get OHLC.  Let's compare the data of the indicator and OHLC.
Set it to close the position if this block of code is executed
 
GeorgeReji:
Set it to close the position if this block of code is executed
Now is the Weekend.  Perhaps in the evening I will show the ready-made working code
 
Vladimir Karputov:
Now is the Weekend.  Perhaps in the evening I will show the ready-made working code
Thanks
 
GeorgeReji :
How can i use an indicator value to close a trade ? I want to use an EMA 8 as take profit level and the trade to automatically close when bid/ask is equal to EMA 8 value

Did I understand your idea correctly?

Close iMA

 
Vladimir Karputov:

Did I understand your idea correctly?


Yes, but the MA is take profit level
 
GeorgeReji:
Yes, but the MA is take profit level
what's wrong?  show your idea in the form of a picture
Reason: