A little help? - page 4

 
deVries:

you have seen here are no errors you don't need the printstatements here

in strategytester your program might work well,

but how is it doing running on your demoaccount ??


I have had it running on a daily time frame - but Ive just applied to 2 minute time frames and seems to be working (at least the 2 starting orders are in the right direction and are now being held) obviously I will be watching them closely.

Im still having a few issues with the indicators which is why they are still there - as it stands the above works fine - but if I add, for example:

double SMA6=iMA(Symbol(),0,6,0,MODE_SMA,PRICE_CLOSE,0);
Print("SMA6 is ",SMA6);
double SMA21=iMA(Symbol(),0,21,0,MODE_SMA,PRICE_CLOSE,0);
Print("SMA21 is ",SMA21);                                    
//----Indicators on a higher timeframe--------------------------------+
double RSI=iRSI(Symbol(),1440,14,PRICE_CLOSE,0);
Print("RSI is ",RSI);                                                             
//----Indicators on a lower timeframe---------------------------------+
double SAR=iSAR(Symbol(),240,0.02,0.2,0);
Print("SAR is ",SAR);
running on a daily time frame, SAR always returns 0 - now, I was half expecting this, since (in the above example) its trying to read 6 different values for 1 value (right?) Is there any way around this?
 

Okay Im confused again - I was trying to see what was going on again and :

double SMA21=iMA(Symbol(),0,21,0,MODE_SMA,PRICE_CLOSE,0);
Print("SMA21 is ",SMA21);                                    
//----Indicators on a higher timeframe--------------------------------+
double RSI=iRSI(Symbol(),1440,14,PRICE_CLOSE,0);
Print("RSI is ",RSI);                                                             
//----Indicators on a lower timeframe---------------------------------+
double SAR=iSAR(Symbol(),240,0.02,0.2,0);
Print("SAR is ",SAR);
double SMA6=iMA(Symbol(),240,6,0,MODE_SMA,PRICE_CLOSE,0);
Print("SMA6 is ",SMA6);
SAR printed 0 as previously - but the SMA printed a value? What?
 
double SAR=iSAR(Symbol(),240,0.02,0.2,0);
  1. Don't hard code numbers, use the enumerations (PERIOD_H4)
  2. Do you have H4 history for the time you're running in the tester?
 

1. Changed - though out of curiousity why does it make a difference?

2. Yeah works perfectly well from the same date on the 4H timeframe and returns values as expected?

I reran the above indicators with SMA6 in the 4H as well in the daily time frame and it read 0 in the beginning before taking a value part way through? But it can be ran in the 4H timeframe from the beginning?

Reason: