Hi!
I am having difficulty running the following code in TS8. when i import it it verifies ok. but when i try to run it on a chart it gives the following error:"tried to reference future data". This code works fine in TS200i. Can you pease check it to see what should be modified to have it run ok in ts8?
thanks!
the code:
I am having difficulty running the following code in TS8. when i import it it verifies ok. but when i try to run it on a chart it gives the following error:"tried to reference future data". This code works fine in TS200i. Can you pease check it to see what should be modified to have it run ok in ts8?
thanks!
the code:
Code:
{==========================================DECLARATIONS=======================}
INPUTS:
STRENGTH(3),
OCCUR(1),
LENGTH(50),
FREEZE(FALSE),
SHOBKOUT(TRUE);
VARS:
BKOUTVAL(0),
BKOUTBAR(0),
BREAKOUT(FALSE),
JLA_LINE(0),
W(0),
STR1(0),
STR2(0),
STR2A(0),
STR3(0),
STR3A(0),
JLA_CTR(0),
TDL1(0),
TDL2(0),
TDL3(0),
TDL1BAR(0),
TDL2BAR(0),
TARGET1(0),
TARGET2(0),
TARGET3(0),
JLA_FRZ(FALSE),
JLA_SLOPE(0);
{+++++++++++++++++++++++++++++FIND POINTS 1 AND 2++++++++++++++++}
TDL1BAR = SWINGLOWBAR(OCCUR,TRUELOW,STRENGTH, LENGTH);
TDL1 = L[TDL1BAR];
TDL2BAR = 0;
TDL2 = 999999;
JLA_CTR = OCCUR + 1;
WHILE TDL2 > TDL1 AND TDL2BAR <= LENGTH AND TDL2BAR <> -1
BEGIN
TDL2BAR = SWINGLOWBAR(JLA_CTR,TRUELOW,STRENGTH,LENGTH);
TDL2 = L[TDL2BAR];
JLA_CTR = JLA_CTR + 1;
END;
IF FREEZE = TRUE THEN JLA_FRZ = TRUE;
{++++++++++++++++++++++++++LOOK FOR BREAKOUT+++++++++++++++++++++}
IF TDL2BAR <> -1 THEN
BEGIN
PLOT3[TDL2BAR](TDL2,"TARGET 3");
PLOT3[TDL1BAR](TDL1,"TARGET 3");
CONDITION15 = FALSE;
BREAKOUT = FALSE;
JLA_SLOPE = (TDL2 - TDL1) / (TDL1BAR - TDL2BAR);
JLA_CTR = TDL1BAR - STRENGTH;
JLA_LINE = 0;
WHILE JLA_CTR >= 0 AND L[JLA_CTR+ 1] > JLA_LINE
BEGIN
JLA_LINE = (TDL1 + (TDL1BAR - JLA_CTR) * JLA_SLOPE);
IF L[JLA_CTR] < JLA_LINE THEN CONDITION15 = TRUE;
JLA_CTR = JLA_CTR - 1;
END;
FOR W = TDL2BAR DOWNTO 0
BEGIN
PLOT1[W](TDL2 + (TDL2BAR - W) * JLA_SLOPE,"UPTREND");
END;
{+++++++++++++++++++++++++BREAKOUT HAS OCCURRED+++++++++++++++++}
IF CONDITION15 AND SHOBKOUT = TRUE THEN
BEGIN
BKOUTBAR = JLA_CTR + 1;
BKOUTVAL = JLA_LINE;
PLOT2[BKOUTBAR](H[BKOUTBAR],"TARGET 2");
{+++++++++++++++++++++++++++BREAKOUT QUALIFIERS+++++++++++++++++}
CONDITION1 = C[BKOUTBAR + 1] > C[BKOUTBAR + 2];
CONDITION2 = OPEN[BKOUTBAR] < BKOUTVAL
AND L[BKOUTBAR +1] > BKOUTVAL;
CONDITION3 = 2 * C[BKOUTBAR + 1] - MAXLIST(C[BKOUTBAR + 2], TRUEHIGH[BKOUTBAR + 1]) > BKOUTVAL;
IF (CONDITION1 OR CONDITION2 OR CONDITION3) THEN
{+++++++++++++++VALID BREAKOUT-SET TARGETS+++++++++++++++++++++++++}
BEGIN
BREAKOUT = TRUE;
IF CHECKALERT THEN ALERT = TRUE; {===this line moved 5/31/96=====}
STR1 = 0;
STR2 = 0;
STR2A = 0;
STR3 = 0;
STR3A = 0;
FOR W = TDL2BAR DOWNTO TDL1BAR
BEGIN
JLA_LINE = (TDL2 + (TDL2BAR - W) * JLA_SLOPE);
IF H[W] - JLA_LINE > STR1 THEN STR1 = H[W] - JLA_LINE;
IF C[W] - JLA_LINE > STR2A THEN
BEGIN
STR2A = C[W] - JLA_LINE;
STR2 = H[W] - JLA_LINE;
END;
IF H[W] - JLA_LINE > STR3A THEN
BEGIN
STR3A = H[W] - JLA_LINE;
STR3 = C[W] - JLA_LINE;
END;
END; {FINISHED DEFINING STRENGTHS}
TARGET1 = BKOUTVAL- STR1;
TARGET2 = BKOUTVAL- STR2;
TARGET3 = BKOUTVAL- STR3;
END; {FINISHED VALID BREAKOUT SETUP}
END; {FINISH BREAKOUT SETUP}
{+++++++++++PLOT STATEMENTS AFTER CONFIRMED BREAKOUT+++++++++++++}
IF BREAKOUT = TRUE THEN
BEGIN
PLOT4[BKOUTBAR](H[BKOUTBAR],"BREAKOUT");
W = BKOUTBAR;
WHILE W >= 0 AND L[W] > MINLIST(TARGET1, TARGET2, TARGET3)
BEGIN
PLOT2[W](TARGET2,"TARGET 2");
PLOT3[W](TARGET3,"TARGET 3");
W = W -1;
END; {FINISHED PLOTTING}
END;{FINISHED BREAKOUT = TRUE}
{+++++++++++++++++++++++++++CLOSE REMAINING LOOPS++++++++++++++}
END; {NO POINT 2}