Forum

backtesting stocks and other non-forex in MT5

I am able to do backtests on forex on my regular metatrader account. In order to get access to stocks I started a demo-account on ActivTrades. The only problem though is that I cannot do backtests on the stocks. Can anyone help me with that

backtesting stocks and other non-forex in MT5

I am able to do backtests on forex on my regular metatrader account. In order to get access to stocks I started a demo-account on ActivTrades. The only problem though is that I cannot do backtests on the stocks. Can anyone help me with that

Copying timeseries and getting Max

ArrayCopy (PeriodHigh, High , 0 , i+ 5 , 25 ); double Max = ArrayMaximum (PeriodHigh, 0 , WHOLE_ARRAY ); I want to select a period of 5 days before the current day in an array. Then after that I want to know what is the highest value of that given period. Somehow though, my code doesn't quit work

Array without specified amount of items

double Buffer1[]; double Buffer2[]; int OnInit() { SetIndexBuffer(0, Buffer1); PlotIndexSetDouble(0, PLOT_EMPTY_VALUE, 0); PlotIndexSetInteger(0, PLOT_ARROW, 241); SetIndexBuffer(1, Buffer2); PlotIndexSetDouble(1, PLOT_EMPTY_VALUE, 0); PlotIndexSetInteger(1, PLOT_ARROW, 242);

getting price/volume data in MQL5 (or 4)

First of all let me say that I am entirely new to MQL programming. But I'd like to know how you can access previous price/volume action to do calculations with it. I think it must be something like this (taking the price as an example)i = price i = 0 if (price[i] < price[i + 1] && price[i + 1] <