can anyone explain me how to do this simple code:
i have an expert advisor, and i have to tell him to stop open new trades for a certain period of time.
practically after that the program close le last trade , this code must stop the ea for a while(like 30m o 1h).
sorry fot the bad english
/* 1) */ Sleep(30*60000); // 30 min, but NOT so good!
/* 2) */ datetime NextTrade = 0; // globally defined
if (TimeCurrent() < NextTrade) return;
If (Stop30Min) NextTrade = TimeCurrent()+30*60; // for 30 min
i read in this forum that sleep doesn't work in the tester
is that true?
look it up in the reference. 'should be ones habit: read the reference,Book, Documentation (links at the top of the page!) or google before asking!
thank for helping me
i have a last question
why this works :double Buy3_1 = iRSI(NULL, 0, 5, PRICE_CLOSE, Current + 0);
and this doesn't : double Buy5_1 = iDeMarker(NULL, 0, 5, 1, PRICE_CLOSE, Current + 0);
i can't understand
it says 'iDeMarker' - wrong parameters count
the same thing happens with MFI
ps I searched for the answer in this forum but I have not found the solution
If you look at iRSI in the documentation, you'll see that it takes 5 parameters (symbol, timeframe, period, applied price and shift).
If you look at iDeMarker in the documentation, you'll see that it takes only 4 parameters (symbol, timeframe, period and shift).
You've provided too many parameters, hence the error.
To add comments, please log in or register