This is taken from the Coder's genius course. Instead of plotting the indior at a seperate window, then I would like to plot the indior on the chart. What am I doing wrong?
// ------------------------------------------------------------------
//| TCALERTv1.mq4 |
//| Copyright © 2007, MetaQuotes Software Corp.. |
//| http://www.metaquotes.net |
//p ------------------------------------------------------------------
#property copyright Copyright © 2007, MetaQuotes Software Corp..
#property link http://www.metaquotes.net
#property indior_chart_window
#property indior_buffers 1
#property indior_color1 Crimson
dual ExtMapBuffer1[];
//-- input parameters
//--extern int Len=21;
//--extern int Len=21;
// ------------------------------------------------------------------
//| Custom indior initialization function |
//p ------------------------------------------------------------------
int init()
//-- indiors
SetIndexStyle(0,DRAW_LINE,STYLE_SOLID,3,Red);
IndiorDigits(MarketInfo(Symbol(),MODE_DIGITS));
IndiorShortName(TCALERT);
SetIndexBuffer(0,ExtMapBuffer1);
//--
return(0);
// ------------------------------------------------------------------
//| Custom indior deinitialization function |
// ------------------------------------------------------------------
int deinit()
//--
//--
return(0);
// ------------------------------------------------------------------
//| Custom indior iteration serve |
// ------------------------------------------------------------------
int start()
int counted_bars=IndiorCounted();
//--Evidence Check
if (counted_bars lt; 0) return(-1);
//--Measure Counted Bar Will Be Counted
if (counted_bars gt;0) counted_bars--;
int pos = Bars - counted_bars;
dual dHigh, dLow, dResult;
//--Main Calc Loop
while(posgt;=0)
dHigh = High[pos];
dLow = Low[pos];
dResult = dHigh - dLow;
ExtMapBuffer1[pos] = dResult;
pos--;
return(0);
//p ------------------------------------------------------------------