//
//============================== Basic setting
defparam cumulateorders = false
//============================== Money Management
Capital = 10000
Lotss = Capital / 6000 // Value of risk on capital (attention)
//============================== setting Management
if Lotss < 0.5 then
Lotss = 0.5
endif
set stop loss (Capital*95)/100
set stop %loss 41
//============================== Indicator
SpanA = (Tenkan[26]+Kijun[26])/2
Tenkan = (highest[9](high)+lowest[9](low))/2
Kijun = (highest[26](high)+lowest[26](low))/2
SpanB = (highest[52](high[26])+lowest[52](low[26]))/2
timeframe(1hours)
XSpanA = (XTenkan[26]+XKijun[26])/2
XTenkan = (highest[9](high)+lowest[9](low))/2
XKijun = (highest[26](high)+lowest[26](low))/2
XSpanB = (highest[52](high[26])+lowest[52](low[26]))/2
timeframe(default)
timeframe(4hours)
XXSpanA = (XXTenkan[26]+XXKijun[26])/2
XXTenkan = (highest[9](high)+lowest[9](low))/2
XXKijun = (highest[26](high)+lowest[26](low))/2
XXSpanB = (highest[52](high[26])+lowest[52](low[26]))/2
timeframe(default)
//============================== setting trend Bullish
T1 = close > Kijun
T2 = close > SpanA and close > SpanB
TrendBullish1 = T1 and T2
timeframe(1hours)
T3 = close > XKijun
T4 = close > XSpanA and close > XSpanB
TrendBullish2 = T4 and T3
timeframe(default)
timeframe(4hours)
T5 = close > XXKijun
T6 = close > XXSpanA and close > XXSpanB
TrendBullish3 = T5 and T6
timeframe(default)
TrendBullish = TrendBullish1 and TrendBullish2 and TrendBullish3
//============================== setting Signal
S1 = low =< Kijun
S2 = low =< SpanA
S3 = low =< SpanB
S = S1 or S2 or S3
Signal = TrendBullish and S
//============================== setting Buy
if Signal then
buy lotss contract at market
endif
if close < kijun and close > positionprice then
sell at market
endif