Is there anyone who knows exactly how the strategy tester processes each bar/tick? I ask because i am developing a custom indicator that uses 3 stock indicators. When i drop the indicator on a chart it looks like i expect but when i run it with a trading simulator through the MT4 strategy tester it is nothing like the charts i dropped it on.
This may be a bit to do with my code but i know its not all my fault. An example:
One of the indicators it uses is RSI (9). Part of the criteria is a cross of 50, so it has the following:
double RSINow = iRSI(NULL,0,RSI,PRICE_CLOSE,i);
double RSILast = iRSI(NULL,0,RSI,PRICE_CLOSE,i+1);
then we compare
if(RSINow < 50 && RSILast > 50) RSICrossDown=true;
(you get the idea, so if the current bar RSI is below 50 but the prev bar RSI is above 50 we have a cross down). Now the RSI cross is only one of the criteria so you wont get an arrow on every RSI cross but obviously if there is no cross you Cant get an arrow (well that is what i thought). After seeing the difference in the charts i added the RSI and watched. There are serveral examples where it has painted the arrow but the RSI never crossed the 50 line.
Can anyone give me some explainations?
This may be a bit to do with my code but i know its not all my fault. An example:
One of the indicators it uses is RSI (9). Part of the criteria is a cross of 50, so it has the following:
double RSINow = iRSI(NULL,0,RSI,PRICE_CLOSE,i);
double RSILast = iRSI(NULL,0,RSI,PRICE_CLOSE,i+1);
then we compare
if(RSINow < 50 && RSILast > 50) RSICrossDown=true;
(you get the idea, so if the current bar RSI is below 50 but the prev bar RSI is above 50 we have a cross down). Now the RSI cross is only one of the criteria so you wont get an arrow on every RSI cross but obviously if there is no cross you Cant get an arrow (well that is what i thought). After seeing the difference in the charts i added the RSI and watched. There are serveral examples where it has painted the arrow but the RSI never crossed the 50 line.
Can anyone give me some explainations?