Hi Folk,
Optuma has gazzumped me in an unfathomable way. Perhaps you can help?
===================================
{some pre code for DPtot, D2P is not duplicated here}
TRADING = SWITCH( (DPtot > 0) and (D2P > 0) and (OFFSET(D2P, OFFSET=1) > 0), (DPtot <= 0) );
BUYPRICE = IF( TRADING, (IF(OFFSET(TRADING, OFFSET=1) , BUYPRICE, ( (close() + open() + high() + low())/4.0) ) ), 0);
SELLPRICE = IF( TRADING, 0, (IF(OFFSET(TRADING, OFFSET=1), ( (close() + open() + high() + low())/4.0 ), 0) ));
THISPROFIT = IF( TRADING, 0, (IF(OFFSET(TRADING, OFFSET=1), (SELLPRICE - BUYPRICE), 0) ));
TOTPROFIT = OFFSET(TOTPROFIT, OFFSET=1) + THISPROFIT;
//Plots
plot1 = DPtot; plot1.Plotstyle = step;
plot1.colour = green;
plot1.visible = 1;
plot2 = D2P;
plot2.Plotstyle = histogram;
plot2.colour = red;
plot3 = TRADING;
plot3.Plotstyle = step;
plot3.colour = black;
plot3.linewidth = 2;
plot3.visible = 1;
plot4 = BUYPRICE;
plot4.Plotstyle = step;
plot4.visible = 1;
plot5 = THISPROFIT;
plot5.Plotstyle = step;
plot5.linewidth = 2;
plot5.visible = 1;
plot6 = SELLPRICE;
plot6.Plotstyle = step;
plot6.linewidth = 2;
plot6.visible = 1;
plot7 = TOTPROFIT;
plot7.Plotstyle = step;
plot7.linewidth = 2;
plot7.visible = 1;
================================
The problem:
If programmed above I get this response from the compiler/interpreter:
yet, when I simply comment out one line, leaving one of the variables undefined, I get this
.... some the interpreter thinks it's OK but it can't possibly work, and it offers no clue as to what is wrong with the script.
...therein is the source of my ansgt.... :-)
Any wisdom?
cheers
colin hales