Following post 15 i discovered that you can input index Bars.getClose
if(CurrentBar < 391) return;
double closePrice16 = Bars.GetClose(389);
double closePrice9 = Bars.GetClose(390);
double difCP = closePrice16 - closePrice9;
double closePrice160 = Bars.GetClose(779);
double closePrice90 = Bars.GetClose(780);
double difCP0 = closePrice160 - closePrice90;
Print("dif"+difCP);
Print("difT"+difCP0);
Print("CP"+closePrice16);
Print("CP"+closePrice9);
double candle = Close[0] + difCP;
Print("Can"+candle);
There's always this but you lose the first transformation and its not antomatic.
if(CurrentBar < 391) return;
double closePrice16 = Bars.GetClose(389);
double closePrice9 = Bars.GetClose(390);
double difCP = closePrice16 - closePrice9;
Print("dif"+difCP);
Print("CP"+closePrice16);
Print("CP"+closePrice9);
double candle = Close[0] + difCP;
Print("Can"+candle);
if(CurrentBar < 781) return;
double closePrice160 = Bars.GetClose(779);
double closePrice90 = Bars.GetClose(780);
double difCP0 = closePrice160 - closePrice90;
Print("difT"+difCP0);
double candlex = Close[0] + difCP0;
Print("CDLX"+candlex);
double candleY = Close[0] + candlex;
Value[0] = candlex;
TY

Comment