From:esignal.com
Tradedog
EL codeCode for first indic:-
Inputs: Length(9),Length2(20),Vollength(3);
Variables: CCIU(0),CCIU2(0),Condition1(false),Condition2(fals e),Condition3(false),Val1(0);
Condition1 = CCI(Length) > 0;
Condition2 = CCI(Length) 0 Then Begin
Avg = Average(High + Low + Close, Length);
MD = 0;
For counter = 0 To Length - 1 Begin
MD = MD + AbsValue(High[counter] + Low[counter] + Close[counter] - Avg);
End;
MD = MD / Length;
If MD = 0 Then
CCI = 0
Else
CCI = (High + Low + Close - Avg) / (0.015 * MD);
End
Else
CCI = 0;
The indicator plots normall cci lines, but instead of plotting them around a 0 line, treats the price line as the 0 line.
10-13-2003, 09:24 AM
--------------------------------------------------------------------------------------------------------------
Tradedog
2nd indic
inputs: len(3.618),Len2(30), Threshold(10);
vars: val(0),val2(0);
val = ergodic_CSI(len);
val2 = ergodic_CSI(len2);
plot1(val, "Ergotic_CSI");
Plot2(val2, "Ergotic_CSI2");
plot4( 0, "Zero");
if AbsValue(val-val[1]) > Threshold then
plot3(val, "ECO SLope")
else
noplot(3);
( Code below is ergodic function)
inputs: len(numericsimple);
vars: val(0),num(0), denom(0);
num = XAverage(XAverage(C-O,5),len);
denom = XAverage(XAverage(H-L,5),len);
if denom > 0 then
val = (num/denom)*100
else
val = 0;
Ergodic_CSI = val;
(courtesy Ralph Peterson)
This plots 2 ergodic lines around a 0 line, their behaviour in relation to each other is very informative. I can elaborate if anyone is interested.
10-13-2003, 09:33 AM
--------------------------------------------------------------------------------------------------------------------------------------Tradedog
third indic code
Input: RSILen(9), LBLen(5), WAvgLen(3), oversold(25), overbought(75),Thresh(40);
Var: RS(0),RSIL(0),RSIH(0),StochRSI(0),SRSI(0),SRSISlop e(0);
RS=RSI(C,RSILen);
RSIL = Lowest(RS,LBLen);
RSIH = Highest(RS,LBLen);
if (RSIH-RSIL) 0 then
StochRSI = (RS - RSIL)/(RSIH-RSIL)
else
StochRSI = .5;
Plot1(WAverage(StochRSI*100,WAvgLen),"Stoch RSI");
Plot2( oversold, "OSold");
Plot3( overbought,"OBought");
SRSI = WAverage(StochRSI*100,WAvgLen);
SRSISlope = TLSlope(SRSI[1],1,SRSI[0],0);
If AbsValue(SRSISlope) > Thresh then
Plot4(SRSI,"Slope alert")
else
NoPlot(4);
(The code for the function is below)
Inputs: Price(NumericSeries), Length(NumericSimple);
Variables: Counter(0), DownAmt(0), UpAmt(0), UpSum(0), DownSum(0), UpAvg(0), DownAvg(0);
If CurrentBar = 1 AND Length > 0 Then Begin
UpSum = 0;
DownSum = 0;
For Counter = 0 To Length - 1 Begin
UpAmt = Price[Counter] - Price[Counter+1];
If UpAmt >= 0 Then
DownAmt = 0
Else Begin
DownAmt = -UpAmt;
UpAmt = 0;
End;
UpSum = UpSum + UpAmt;
DownSum = DownSum + DownAmt;
End;
UpAvg = UpSum / Length;
DownAvg = DownSum / Length;
End
Else
If CurrentBar > 1 AND Length > 0 Then Begin
UpAmt = Price[0] - Price[1];
If UpAmt >= 0 Then
DownAmt = 0
Else Begin
DownAmt = -UpAmt;
UpAmt = 0;
End;
UpAvg = (UpAvg[1] * (Length - 1) + UpAmt) / Length;
DownAvg = (DownAvg[1] * (Length - 1) + DownAmt) / Length;
End;
If UpAvg + DownAvg 0 Then
RSI = 100 * UpAvg / (UpAvg + DownAvg)
Else
RSI = 0;
Ralph Peterson calls this stochastic RSI. Its a great indicator. I would imagine e signals function for RSI would do the job.
Please note all slope alerts in TS2000i are plotted as dots on the indicator line. Useful, not essential.
10-13-2003, 09:42 AM
--------------------------------------------------------------------------------------------------------------------
Tradedog
More code
Inputs: Length(5);
Variables: gap(0);
gap = Absvalue(XAverage(Close, Length) - AverageFC(Open, Length));
If Average(Close, Length) > Average(Open, Length)
and gap > .2
Then Begin
Plot1(200, "CMA>OMA");
Alert("Close Average is greater than Open Average");
End
Else Begin
NoPlot(1);
End;
If Average(Close, Length) .25
Then Begin
Plot2(200, "CMA
- Jul 07 Sat 2012 16:56
Tradedog在esignal.com發表的code
close
全站熱搜
留言列表
發表留言