Hi all, i tried to convert these codes into a TOS scan but received an error message, "too complex exceptions......
May i request some help to convert this into a scan.
Thanks
May i request some help to convert this into a scan.
Thanks
Code:
declare lower;
input days_above_50ma = 125;
def mystery = AbsValue(close>average(close,50)) + AbsValue(close[1]>average(close,50)[1]) + AbsValue(close[2]>average(close,50)[2]) + AbsValue(close[3]>average(close,50)[3]) +
AbsValue(close[4]>average(close,50)[4]) + AbsValue(close[5]>average(close,50)[5]) + AbsValue(close[6]>average(close,50)[6]) + AbsValue(close[7]>average(close,50)[7]) +
AbsValue(close[8]>average(close,50)[8]) + AbsValue(close[9]>average(close,50)[9]) + AbsValue(close[10]>average(close,50)[10]) + AbsValue(close[11]>average(close,50)[11]) +
AbsValue(close[12]>average(close,50)[12]) + AbsValue(close[13]>average(close,50)[13]) + AbsValue(close[14]>average(close,50)[14]) + AbsValue(close[15]>average(close,50)[15]) +
AbsValue(close[16]>average(close,50)[16]) + AbsValue(close[17]>average(close,50)[17]) + AbsValue(close[18]>average(close,50)[18]) + AbsValue(close[19]>average(close,50)[19]) +
AbsValue(close[20]>average(close,50)[20]) + AbsValue(close[21]>average(close,50)[21]) + AbsValue(close[22]>average(close,50)[22]) + AbsValue(close[23]>average(close,50)[23]) +
AbsValue(close[24]>average(close,50)[24]) + AbsValue(close[25]>average(close,50)[25]) + AbsValue(close[26]>average(close,50)[26]) + AbsValue(close[27]>average(close,50)[27]) +
AbsValue(close[28]>average(close,50)[28]) + AbsValue(close[29]>average(close,50)[29]) + AbsValue(close[30]>average(close,50)[30]) + AbsValue(close[31]>average(close,50)[31]) +
AbsValue(close[32]>average(close,50)[32]) + AbsValue(close[33]>average(close,50)[33]) + AbsValue(close[34]>average(close,50)[34]) + AbsValue(close[35]>average(close,50)[35]) +
AbsValue(close[36]>average(close,50)[36]) + AbsValue(close[37]>average(close,50)[37]) + AbsValue(close[38]>average(close,50)[38]) + AbsValue(close[39]>average(close,50)[39]) +
AbsValue(close[40]>average(close,50)[40]) + AbsValue(close[41]>average(close,50)[41]) + AbsValue(close[42]>average(close,50)[42]) + AbsValue(close[43]>average(close,50)[43]) +
AbsValue(close[44]>average(close,50)[44]) + AbsValue(close[45]>average(close,50)[45]) + AbsValue(close[46]>average(close,50)[46]) + AbsValue(close[47]>average(close,50)[47]) +
AbsValue(close[48]>average(close,50)[48]) + AbsValue(close[49]>average(close,50)[49]) + AbsValue(close[50]>average(close,50)[50]) + AbsValue(close[51]>average(close,50)[51]) +
AbsValue(close[52]>average(close,50)[52]) + AbsValue(close[53]>average(close,50)[53]) + AbsValue(close[54]>average(close,50)[54]) + AbsValue(close[55]>average(close,50)[55]) +
AbsValue(close[56]>average(close,50)[56]) + AbsValue(close[57]>average(close,50)[57]) + AbsValue(close[58]>average(close,50)[58]) + AbsValue(close[59]>average(close,50)[59]) +
AbsValue(close[60]>average(close,50)[60]) + AbsValue(close[61]>average(close,50)[61]) + AbsValue(close[62]>average(close,50)[62]) + AbsValue(close[63]>average(close,50)[63]) +
AbsValue(close[64]>average(close,50)[64]) + AbsValue(close[65]>average(close,50)[65]) + AbsValue(close[66]>average(close,50)[66]) + AbsValue(close[67]>average(close,50)[67]) +
AbsValue(close[68]>average(close,50)[68]) + AbsValue(close[69]>average(close,50)[69]) + AbsValue(close[70]>average(close,50)[70]) + AbsValue(close[71]>average(close,50)[71]) +
AbsValue(close[72]>average(close,50)[72]) + AbsValue(close[73]>average(close,50)[73]) + AbsValue(close[74]>average(close,50)[74]) + AbsValue(close[75]>average(close,50)[75]) +
AbsValue(close[76]>average(close,50)[76]) + AbsValue(close[77]>average(close,50)[77]) + AbsValue(close[78]>average(close,50)[78]) + AbsValue(close[79]>average(close,50)[79]) +
AbsValue(close[80]>average(close,50)[80]) + AbsValue(close[81]>average(close,50)[81]) + AbsValue(close[82]>average(close,50)[82]) + AbsValue(close[83]>average(close,50)[83]) +
AbsValue(close[84]>average(close,50)[84]) + AbsValue(close[85]>average(close,50)[85]) + AbsValue(close[86]>average(close,50)[86]) + AbsValue(close[87]>average(close,50)[87]) +
AbsValue(close[88]>average(close,50)[88]) + AbsValue(close[89]>average(close,50)[89]) + AbsValue(close[90]>average(close,50)[90]) + AbsValue(close[91]>average(close,50)[91]) +
AbsValue(close[92]>average(close,50)[92]) + AbsValue(close[93]>average(close,50)[93]) + AbsValue(close[94]>average(close,50)[94]) + AbsValue(close[95]>average(close,50)[95]) +
AbsValue(close[96]>average(close,50)[96]) + AbsValue(close[97]>average(close,50)[97]) + AbsValue(close[98]>average(close,50)[98]) + AbsValue(close[99]>average(close,50)[99]) +
AbsValue(close[100]>average(close,50)[100]) + AbsValue(close[101]>average(close,50)[101]) + AbsValue(close[102]>average(close,50)[102]) +
AbsValue(close[103]>average(close,50)[103]) + AbsValue(close[104]>average(close,50)[104]) + AbsValue(close[105]>average(close,50)[105]) +
AbsValue(close[106]>average(close,50)[106]) + AbsValue(close[107]>average(close,50)[107]) + AbsValue(close[108]>average(close,50)[108]) +
AbsValue(close[109]>average(close,50)[109]) + AbsValue(close[110]>average(close,50)[110]) + AbsValue(close[111]>average(close,50)[111]) +
AbsValue(close[112]>average(close,50)[112]) + AbsValue(close[113]>average(close,50)[113]) + AbsValue(close[114]>average(close,50)[114]) +
AbsValue(close[115]>average(close,50)[115]) + AbsValue(close[116]>average(close,50)[116]) + AbsValue(close[117]>average(close,50)[117]) +
AbsValue(close[118]>average(close,50)[118]) + AbsValue(close[119]>average(close,50)[119]) + AbsValue(close[120]>average(close,50)[120]) +
AbsValue(close[121]>average(close,50)[121]) + AbsValue(close[122]>average(close,50)[122]) + AbsValue(close[123]>average(close,50)[123]) +
AbsValue(close[124]>average(close,50)[124]);
plot x = mystery >= days_above_50ma;
AddCloud(if x then 1 else Double.NaN, if x then 0 else Double.NaN, Color.red, Color.CURRENT);
Last edited by a moderator: