i've built an strategy that plots NYSE TRIN (as a line), and when i plote it for instance in a 5 minutes chart the TRIN data starts 19 bars late, here is part of the formula:
function main() {
var f = call("/Downloads/VIDYA.efs");
var Slow_MA = MASlow.getValue(MAStudy.MA);
var nTrinLong = 1.40; // Habilita Long bajo esto
var nTrinShort = 0.70; // Habilita Short por sobre esto
var marcotiempo = "5" // Intervalo de la Carta
var nBarState = getBarState();
if (nBarState == BARSTATE_ALLBARS){
vSymbol = "$TRIN," + marcotiempo ;
}
if ( f == null || Slow_MA == null)
return;
var nTRIN = close(0, 1, vSymbol);
if (nTRIN == null)
return;
//* var nBarState2 = getBarState();
//* if (nBarState2 == BARSTATE_ALLBARS){
//* vSymbol2 = "$TICK,1";
//* } *//
// var nTICK = close(0, 1, "$TICK,5");
// if (nTICK == null)
// return;
var vtime = getValue("Time");
if (vtime == null)
return;
var tag1 = 60 * vtime.getHours() + vtime.getMinutes();
if(tag1 >= 720 && tag1 <= 810) {
tag2 = 1;
} else tag2 =0;
any suggestion will be much appreciated
function main() {
var f = call("/Downloads/VIDYA.efs");
var Slow_MA = MASlow.getValue(MAStudy.MA);
var nTrinLong = 1.40; // Habilita Long bajo esto
var nTrinShort = 0.70; // Habilita Short por sobre esto
var marcotiempo = "5" // Intervalo de la Carta
var nBarState = getBarState();
if (nBarState == BARSTATE_ALLBARS){
vSymbol = "$TRIN," + marcotiempo ;
}
if ( f == null || Slow_MA == null)
return;
var nTRIN = close(0, 1, vSymbol);
if (nTRIN == null)
return;
//* var nBarState2 = getBarState();
//* if (nBarState2 == BARSTATE_ALLBARS){
//* vSymbol2 = "$TICK,1";
//* } *//
// var nTICK = close(0, 1, "$TICK,5");
// if (nTICK == null)
// return;
var vtime = getValue("Time");
if (vtime == null)
return;
var tag1 = 60 * vtime.getHours() + vtime.getMinutes();
if(tag1 >= 720 && tag1 <= 810) {
tag2 = 1;
} else tag2 =0;
any suggestion will be much appreciated
Comment