Hi. I’m trying to create a script that will yield a “True” value when:
- The code’s ADX trend line is above 20
- The code’s ADX trend line has been up each of the past 10 bars
- The code’s ADX DMPlus value is greater than the DMMinus value
I’d think the following script should yield this result:
D1 = GETDATA(CODE=SPX:WI, TIMEFRAME=1 Week);
A1=ADX(D1);
A2=ADX(D1, DEFAULT=DMPlus);
A3=ADX(D1, DEFAULT=DMMinus);
ADX_GT_Thresh = (A1 > 20);
ADX_IsUp = (BARSTRUE(A1() IsUp, LOOKBACK=10) = 10);
DMP_GT_DMM = (A2 > A3);
ADX_Bull = ADX_GT_Thresh and ADX_IsUp and DMP_GT_DMM;
ADX_Bull
However, displaying the script via Show View is not at all yielding the expected result. What am I doing wrong?
Thanks!