매수 전략은 AO+Stoch+RSI+ATR에 달려 있습니다.

저자:차오장, 날짜: 2022-05-20 15:52:46
태그:RSIATR스톡SMA

이 전략은 훈련용일 뿐입니다. 소나무 문자로 코드를 배우는 것입니다. 이 전략으로 구매 또는 판매 결정을 하지 마십시오.

터키/터키 이 전략은 단지 파이인 스크립트 코딩을 어떻게 할 수 있는지 알아내기 위한 것입니다. 이 전략은 확실히 알-사트 이슬람교를 막는 것입니다.

어떻게 작동하죠?

RSI와 스톡이 과잉 판매 영역에 있고, 만약 awesome osc.가 긍정적으로 변하면, 긴 포지션을 취합니다. Stop loss 및 take profit 레벨은 ATR ind로 정의되었습니다.

RSI와 주식가치가 과잉 매입되면 마이너스로 변하면 쇼트 포지션을 취합니다.

터키/터키

RSI와 주식 증권 지역에서는 엄청난 긍정적 인 지점이 큰 지점으로 나타났고, ATR 지표의 수준이 낮았습니다.

RSI와 주식 지표는 아주 좋은 마이너스 순위를 기록했고, ATR 지표의 수준은 낮아졌습니다.

백테스트 img


/*backtest
start: 2022-04-19 00:00:00
end: 2022-05-18 23:59:00
period: 30m
basePeriod: 15m
exchanges: [{"eid":"Futures_Binance","currency":"BTC_USDT"}]
*/

//@version=4

strategy("Buy&Sell Strategy depends on AO+Stoch+RSI+ATR by SerdarYILMAZ", shorttitle="Buy&Sell Strategy")
// Created by Serdar YILMAZ
// This strategy is just for training, its purpose is just learning code in pine script.
// Don't make buy or sell decision with this strategy.
// Bu strateji sadece pine script'te kodlamanın nasıl yapildigini ogrenmek icindir.
// Bu stratejiye dayanarak, kesinlikle al-sat islemleri yapmayin.

//AO

fast=input(title="Fast Length",type=input.integer,defval=3)
slow=input(title="Slow length",type=input.integer,defval=17)

awesome=(sma(hl2,fast)-sma(hl2,slow))*1000

plot(awesome, style=plot.style_histogram, color=(awesome>awesome[1]?color.green:color.red))

//Stoch

K=input(title="K",type=input.integer,defval=14)
D=input(title="D",type=input.integer,defval=3)
smooth=input(title="smooth",type=input.integer,defval=3)

k=sma(stoch(close,high,low,K),D)
d=sma(k,smooth)

hline(80)
hline(20)

plot(k,color=color.blue)

//RSI

rsisource=input(title="rsi source",type=input.source,defval=low)
rsilength=input(title="rsi length",type=input.integer,defval=10)

rsi=rsi(rsisource,rsilength)

hline(70,color=color.orange)
hline(30,color=color.orange)

plot(rsi,color=color.orange)

//ATR

atrlen=input(title="ATR Length", type=input.integer,defval=14)

atrvalue=rma(tr,atrlen)

plot(atrvalue*1000,color=color.green)

LongCondition=k<20 and rsi<30 and awesome>awesome[1]
ShortCondition=k>80 and rsi>70 and awesome<awesome[1]
if (LongCondition)
    stoploss=low-atrvalue
    takeprofit=close+atrvalue
    strategy.entry("Long Position", strategy.long)
    strategy.exit("TP/SL",stop=stoploss,limit=takeprofit)
    
if (ShortCondition)
    stoploss=high+atrvalue
    takeprofit=close-atrvalue
    strategy.entry("Short Position",strategy.short)
    strategy.exit("TP/SL",stop=stoploss,limit=takeprofit)
    
    

    
    




관련

더 많은