Los geht’s:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
defparam flatbefore = 080500
defparam flatafter = 213000
//
if intradaybarindex = 0 then
trading= 1
elsif barindex = tradeindex then
trading= 0
endif
//
if time = 080500 then
mypriceL= close - AverageTrueRange [ 14 ] (close )* 3
tpL = close - mypriceL
slL = tpL * 2
mypriceS= close + AverageTrueRange [ 14 ] (close )* 3
tpS = mypriceS- close
slS = tpS * 2
elsif time > 080500 and time [ 1 ] < 080500 then
mypriceL= close [ 1 ]
mypriceS= close [ 1 ]
endif
//
if not longonmarket and trading= 1 then
buy 1 share at mypriceL limit
set stop loss slL
set target profit tpL
BreakEven = tpL * 0.7
endif
//
if not shortonmarket and trading= 1 then
sellshort 1 share at mypriceS limit
set stop loss slS
set target profit tpS
BreakEven = tpL * 0.7
endif
//
IF LongOnmarket THEN
IF ExitPrice = 0 THEN
IF (close - TradePrice ) >= BreakEven THEN
ExitPrice = TradePrice
ENDIF
ELSE
SELL AT ExitPrice STOP
ENDIF
ELSIF ShortOnMarket THEN
IF ExitPrice = 0 THEN
IF (TradePrice - close ) >= BreakEven THEN
ExitPrice = TradePrice
ENDIF
ELSE
EXITSHORT AT ExitPrice STOP
ENDIF
ELSE
ExitPrice = 0
ENDIF
Ich habe PLOSS in LOSS geändert.
Ich habe die Gewinnschwelle hinzugefügt, wenn ein Gewinn von 70% erreicht ist.
Ich habe sowohl Short- als auch Long-Trades hinzugefügt.
Ich füge separate SL und TP für Short- und Long-Trades hinzu.
@ axmichi Zeile 15 für kurz SL ist falsch, es sollte geschrieben werden
Ich hänge auch die .ITF-Datei an.