![]() This accout has been deleted | I modified a stochastic momentum indicator by Mel Dickover by adding a signal line and using the original formula by Blau. Since I no experience with programming, I was amazed that it works just like the TOS platform indicator. I want to make a system that produces a long signal when the SMI line crosses above signal line and vice versa for the short signal. I also wanted to produce code to do the same in omniscan. Unfortunately, as this indicator is coded, I have no idea how to do this. I don't know how to access "SMI" to write a crossover with the EMA(3) of the SMI. Any nudges in the right direction would be greatly appreciated. Indicator code listed below: #Indicator 'MySMI 'Stochastic Momentum Index indicator 'with signal line 'Based off initial indicator, SMI ' Coded by Mel Dickover April 2012 '------------------------------------------ #param "lookback", 5 #param "thresholdLong",-80 #param "thresholdShort",+80 dim temp1, temp2, temp3, temp4, temp5, temp6 as single dim x as single dim y as single temp1 = (HHV(H,lookback)+LLV(L,lookback))*0.5 ' C temp2 = C[0] - temp1 ' D temp3 = EMA(temp2,3) 'DS1 temp4 = EMA(temp3,3) 'DS2 temp5 = EMA((HHV(H,lookback) - LLV(L,lookback)),3) 'DHL temp6 = ema(temp5*0.5,3) 'DHL2 x = 100*(temp4/temp6) y = EMA(x,3) plot("SMI",x) plot("Signal line",y) plot("Thresholdlong",thresholdLong) plotLabel(thresholdLong) plot("Thresholdshort",thresholdShort) plotLabel(thresholdshort) Return x ' Return the value calculated by the indicator Return y ' Return the value calculated by the signal line ![]() |