Help I am trying to write an EA that requires pivot points

 

Hello, I need some help please i am trying to write a bot that requires pivot points, my problem is that all i get from the iHigh, iLow, and iClose values are 0's. I figured out that i could use the ihighest and ilowest to obtain these 2 values however what can i do about iclose. Thanks for your time.

 

Post your code .

 

This Line of code produces nothing but zeros.



Comment("GBPUSD Close: ", iClose("GBPUSD",PERIOD_D1,1));
	          
 
faqcya:

This Line of code produces nothing but zeros.



Comment("GBPUSD Close: ", iClose("GBPUSD",PERIOD_D1,1)); 


A possibility:

double iClose( string symbol, int timeframe, int shift)
Returns Close value for the bar of indicated symbol with timeframe and shift. If local history is empty (not loaded), function returns 0.

 
How do you load local history?
 

Open a Daily Chart for GBPUSD.

This may not be your problem, but you haven't given much to work with.

Also, you can open the History Center. Open up a pair, grayed out time periods
seem to indicate it is not or not yet collecting a history for that time period.

Double click grayed out times and they become colored.

The download button at the bottom downloads from Metaquotes, not your
dealer database. It gives a warning about that.

 

Heres the code

 

Lets try this again:

double R1, R2, R3, PP, S1, S2, S3, H, L, C, Range;

//H=High[est(NULL,PERIOD_D1,MODE_HIGH,1,1)];

//L=Low[est(NULL,PERIOD_D1,MODE_LOW,1,1)];

C=iClose("GBPUSD", PERIOD_D1,1);

H=iHigh("GBPUSD", PERIOD_D1,1);

L=iLow("GBPUSD", PERIOD_D1,1);

Range=H-C;

PP =(H+L+C)/3 ;

R1 = (2*PP) - L;

R2 = PP+Range;

R3 = PP+(Range*2);

S1 = (2*PP) - H;

S2 = PP+Range;

S3 = PP+(Range*2);

Comment("Yesterdays High: ", H, " Yesterdays Low: ", L, " Yesterdays Close: ", C, " Range: ", Range, " PP= ", PP, " R1= ", " R2= ", R2, " R3= ", R3, " S1= ", S1, " S2= ", S2, " S3= ", S3, " RSI: ", iRSI(NULL, PERIOD_D1,9,PRICE_CLOSE,1));

 
tried puting it on a daily chart, tried downloading the chart, made sure it wasn't greyed out in history center, still 0's
 
It compiles fine and i get an accurate reading for the RSI, but nothing else
 

Using that code above works here. Gives values, looks like they might be right.

Replace "GBPUSD" with Symbol() for a test.

C=iClose(Symbol(),PERIOD_D1,1);

H=iHigh(Symbol(),PERIOD_D1,1);

L=iLow(Symbol(),PERIOD_D1,1);

Print("Format of this pairname is ", Symbol());

Check terminal for the printout.