Hallo @Despair,
vielen Dank. Aber diese Art eines Außenstabes meine ich nicht.
Ich habe ein neuen Versuch gestartet und der ist gescheitert. Das Programm meint ich hätte die Variablen nicht verteilt.
Was möchte ich mit dem Code erreichen?
Er soll Innenstäbe und Außenstäbe erkennen. Und zwar ist die Difinition eine andere als die, die du mir gezeigt hast Despair.
Die Innenstäbe sollen unterhalb des Hochs eines Außenstaben und überhalb des Tiefs des Außenstabes sein.
Ein Außenstab ensteht wenn der close über dem hoch des letzen Außenstabes liegt
oder wenn ein close unterhalb des letzen tiefs liegt.
Oder Wenn ein Innenstab close über ein hoch eines Außenstabes liegt, oder Wenn ein Innenstab Close unter ein tief eines Außenstabes liegt.
Die Variabeln:
ASHLONG = Außenstab hoch/high long
ASTLONG = Außenstab tief/low long
ASHSHORT = Außenstab high/Hoch Short
ASTSHORT = Außenstab tief/low Short
ISHLONG = Innenstab hoch/high long
ISTLONG = Innenstab Tief/low long
ISHSHORT = Innenstab Hoch/high Short
ISTSHORT = Innenstab Tief/low Short
Ich habe es mal Bildlich dargestellt.
b = 0
c = 0
g = 0
i = 0
IF c = 0 THEN
IF close[0] > high[1] THEN
a = low[0] AND b = high[0] AND c = 1
endif
endif
IF close[0] > b AND g = 0 THEN
g = 1 AND ASHLONG = high[0] AND ASTLONG = low[0]
endif
IF close[0] < a AND i = 0 THEN
i = 1 AND ASHShort = high[0] AND ASTShort = low[0]
endif
If g = 1 AND close[0] < ASHLONG AND close[0] > ASTLONG THEN
ISHLONG = close[1] AND ISTLong = close[0]
endif
IF close[0] < ASHShort AND close[0] > ASTShort THEN
ISHShort = close[1] AND ISTShort = close[0]
endif
IF g = 1 AND ISHLONG > ASHLONG THEN
ASHLONG = high[0] AND ASTLONG = low[0]
endif
IF g = 1 AND ISTLong < ASTLONG THEN
ASHShort = high[0] AND ASTShort = low[0]
endif
IF ISHSHORT < ASHSHORT THEN
ASHLong = high[0] AND ASTLong = low[0]
endif
IF ISHSHORT > ASHSHORT THEN
ASHSHORT = high[0] AND ASTSHORT = low[0]
endif
RETURN ASHSHORT AS "low", ASHLONG AS "high"