Coding problem to initiate buy trade
Hi
Can anyone help to initiate trade when price is above MA and high of three bullish candle breaks.
Files:
1652191552859-1.png
7 kb
Safeer Altaf :
Hi
Hi
Can anyone help to initiate trade when price is above MA and high of three bullish candle breaks.
1. Create an indicator handle in OnInit.
2. In OnTick, determine the moment when the price crossed the iMA indicator - remember this date.
3. If there is a stored date, use CopyRates third form:
int CopyRates( string symbol_name, // symbol name ENUM_TIMEFRAMES timeframe, // period datetime start_time, // start date and time datetime stop_time, // end date and time MqlRates rates_array[] // target array to copy );
and looking for three vertices.

Documentation on MQL5: Timeseries and Indicators Access / CopyRates
- www.mql5.com
CopyRates - Timeseries and Indicators Access - MQL5 Reference - Reference on algorithmic/automated trading language for MetaTrader 5

You are missing trading opportunities:
- Free trading apps
- Free Forex VPS for 24 hours
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register