Coding problem to initiate buy trade

Safeer Altaf
14
Hi

Can anyone help to initiate trade when price is above MA and high of three bullish candle breaks.
Files:
Vladimir Karputov
Moderator
301933
Safeer Altaf :
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
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