Deutsch

INDIZES

30.12.07 00:25
Re: INDIZES
 
  blackalex69 завсегдатай
в ответ blackalex69 30.12.07 00:21, Последний раз изменено 30.12.07 00:40 (blackalex69)
А вот этот индикатор уже показывает точки входа и выхода по StochRSI стратегии
//+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
// StochRSI Indikator
// p - Periode in Tagen ( 7 ist fuer DAX optimal )
//+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
p = 7
Value1 = RSI[p](Close) - Lowest[p](RSI[p](Close))
Value2 = Highest[p](RSI[p](Close)) - Lowest[p](RSI[p](Close))
IF Value2 <> 0 THEN
Value3 = Value1 / Value2
ENDIF
// StochRSI-Wert
storsi = ExponentialAverage[p](Value3)*100
//+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
// Awesome Oscillator AO (wird fuer die Trend-Ermittlung benoetigt )
//+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
AO=Average[5](MedianPrice)-Average[34](MedianPrice)
//+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
// M A I N
//+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
// Regeln fuer den Long-Einstieg
// 1) AO > 0
// 2) StochRSI ist unter 40 gefallen und dreht sich nach oben
// 3) Man geht long zum Schlusskurs. Stoploss wird um 0,3% unter dem Tief vom Einstiegsbalken gesetzt
// 4) Drei mögliche Ausstiegsvarianten:
// a) Ausstieg nach 50 Punkten. Die Position wird komplett glattgestellt
// b) Stoploss wird gerissen
// c) StochRSI steigt ueber 70
//+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
golong = storsi[1] <= 40 and storsi > storsi[1] and storsi[1] < storsi[2] and AO > 0
//+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
// Regeln fuer den Short-Einstieg
// 1) AO < 0
// 2) StochRSI ist ueber 70 gestiegen und dreht sich nach unten
// 3) Man geht short zum Schlusskurs. Stoploss wird um 0,3% ueber dem Hoch vom Einstiegsbalken gesetzt
// 4) Drei mögliche Ausstiegsvarianten:
// a) Ausstieg nach 50 Punkten. Die Position wird komlett glattgestellt
// b) Stoploss wird gerissen
// c) StochRSI faellt unter 30
//+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
goshort = storsi[1] >=70 and storsi < storsi[1] and storsi[1] > storsi[2] and AO < 0
//+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
// Variablendeklaration
//+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
// Ausstieg nach 50 Punkten
ausstieg = 50
enterlong = 0
entershort = 0
quitlong = 0
quitshort = 0
//+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
// Long Einstieg
//+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
if golong and not belong then
enterlong = 1
stoplosslong = low * 0.997
belong = 1
buypricelong = close
endif
//+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
// Long Ausstieg
//+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
if belong then
if storsi crosses over 70 or close - buypricelong >= ausstieg or high crosses under stoplosslong then
quitlong = -0.5
belong = 0
endif
endif
//+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
// Short Einstieg
//+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
if goshort and not beshort then
entershort = -1
stoplossshort = high * 1.003
beshort = 1
buypriceshort = close
endif
//+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
// Short Ausstieg
//+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
if beshort then
if storsi crosses under 30 or buypriceshort - close >= ausstieg or high crosses over stoplossshort then
quitshort = 0.5
beshort = 0
endif
endif
return enterlong as "GoLong", quitlong as "ExitLong", entershort as "GoShort", quitshort as "ExitShort"

 

Перейти на