I'm trying to get a moving average of the close values from Heiken Ashi. Here is the code:
The only values I get are 0.00000 on my chart. Can someone show me where I went wrong?
THANKS!
Inserted Code
#property indicator_chart_window #property indicator_buffers 1 #property indicator_color1 Green double varValue[]; double tmpValue[]; //+------------------------------------------------------------------+ //| Custom indicator initialization function | //+------------------------------------------------------------------+ int init() { //---- indicators SetIndexBuffer(0, varValue); SetIndexLabel(0,"Diff"); SetIndexStyle(0,DRAW_LINE); //---- return(0); } //+------------------------------------------------------------------+ //| Custom indicator deinitialization function | //+------------------------------------------------------------------+ int deinit() { //---- //---- return(0); } //+------------------------------------------------------------------+ //| Custom indicator iteration function | //+------------------------------------------------------------------+ int start() { int counted_bars=IndicatorCounted(); //---- int limit; string dt; limit=Bars-counted_bars; for(int i=0; i < limit; i++) { for (int j=i; j<j-6; j++) { tmpVaule[i]=iCustom(NULL,0,"HeikenAshi",3,j); } varValue[i]=iMAOnArray(tmpValue,0,5,0,MODE_SMMA,0); } return(0); }
The only values I get are 0.00000 on my chart. Can someone show me where I went wrong?
THANKS!