SekalperKG replies to: I will code your EAs and Indicators for no charge

Why I am getting different values of Heiken Ashi candles in Data Window & in my code values I am getting from my code is mentioned in highlighted logs.

Inserted Code

datetime H1,H4;
double OPEN,CLOSE,H1EMAprev,HAHigh,HALow,HAOpen,HAClose,H1iHighest, NewClose,NewOpen,NewHigh,NewLow;
int total=9999999999,i; OPEN=iCustom(_Symbol,PERIOD_H1,"Heiken Ashi",Red,White,Red,White,2,1); CLOSE=iCustom(_Symbol,PERIOD_H1,"Heiken Ashi",Red,White,Red,White,3,1); H1EMAprev=NormalizeDouble(iMA(_Symbol,PERIOD_H1,14,0,MODE_EMA,PRICE_CLOSE,1),Digits()); if(H1!=iTime(Symbol(),PERIOD_H1,0)) // new candle on D1 { if(OPEN<CLOSE) { for(i=0;i<total;i++) { OPEN=NormalizeDouble(iCustom(_Symbol,PERIOD_H1,"Heiken Ashi",Red,White,Red,White,2,i),Digits); CLOSE=NormalizeDouble(iCustom(_Symbol,PERIOD_H1,"Heiken Ashi",Red,White,Red,White,3,i),Digits); HAHigh= NormalizeDouble(iCustom(_Symbol,PERIOD_H1,"Heiken Ashi",0,i),Digits); HALow = NormalizeDouble(iCustom(_Symbol,PERIOD_H1,"Heiken Ashi",1,i),Digits); HAOpen= NormalizeDouble(iCustom(_Symbol,PERIOD_H1,"Heiken Ashi",2,i),Digits); HAClose=NormalizeDouble(iCustom(_Symbol,PERIOD_H1,"Heiken Ashi",3,i),Digits); H1iHighest=NormalizeDouble(iHigh(Symbol(),PERIOD_H1,iHighest(Symbol(),PERIOD_H1,MODE_HIGH,i-1,i)),Digits);
// NewClose=(Open[i]+High[i]+Low[i]+Close[i])/4;
// NewOpen = (Open[i-1] + Close[i-1])/2;
// NewHigh = MathMax(High[i-1],MathMax(Open[i],Close[i]));
// NewLow=MathMin(Low[i-1],MathMin(Open[i],Close[i])); if(OPEN<CLOSE) { Print("its White, i: ",i,", HAHigh: ",HAHigh,", HALow: ",HALow,", HAOpen: ",HAOpen,", HAClose: ",HAClose, ", OPEN: ",OPEN,", CLOSE: ",CLOSE,", Symbol: ",_Symbol,", H1iHighest: ",H1iHighest); Print("its White, i: ",i,", NewClose: ",NewClose,", NewOpen: ",NewOpen,", NewHigh: ",NewHigh,", NewLow: ",NewLow); break; } } } else { Print("its Red"); } //Do Something... H1=iTime(Symbol(),PERIOD_H1,0); // overwrite old with new value }

Attached Image (click to enlarge)

Click to Enlarge Name: Screen Shot 2018-08-24 at 8.23.27 PM.png Size: 77 KB

Leave a Reply

Your email address will not be published. Required fields are marked *