답변완료
안녕하세요
length = input(14, title="Length")
doavg = input(true,title="Do Average?")
avg = input(4, title="Average Length")
l1 = input(-61.8, title="EC")
l2 = input(-50.0, title="Midline")
l3 = input(-38.2, title="Tr")
str = sum(tr,length)
ltl = lowest(low <= close[1] ? low : close[1],length)
hth = highest(high >= close[1] ? high : close[1],length)
height = hth - ltl
chop = 100 * (log10(height / str) / log10(length))
plot(chop, color=#42B0FF, linewidth=2)
plot(doavg ? sma(chop,avg) : na, color=white)
hli1 = hline(l1)
hli2 = hline(l2)
hli3 = hline(l3)
변환 문의드립니다. 감사합니다.
2020-03-05
586
글번호 136604
지표
답변완료
부탁드립니다.
아래식에서
SetStopTrailing의 최대 익절대비 5틱 하락시 청산과 같은 방법으로
SetStopLoss도 최대 손실 대비 5틱 상승시 청산으로 수정부탁드립니다.
청산 명령어가 없으면 1)식에서 최대한 같은 식으로 수정 부탁드립니다.
SetStopTrailing(5,익절,PointStop);
SetStopLoss(손절,PointStop);
1)식
var : BH(0),SL(0),HE(0),LE(0);
if MarketPosition == 1 Then{
BH = highest(H,BarsSinceEntry);
if MaxEntries == 1 Then
HE = LatestEntryPrice(0);
if MaxEntries >= 2 and LatestEntryPrice(0) > HE Then
HE = LatestEntryPrice(0);
if BH >= EntryPrice+PriceScale*익절1 then{
ExitLong("B익절1",AtStop,BH-(BH-EntryPrice)*익절1하락퍼센트); }
}
if MarketPosition == -1 Then{
SL = Lowest(L,BarsSinceEntry);
if MaxEntries == 1 Then
LE = LatestEntryPrice(0);
if MaxEntries >= 2 and LatestEntryPrice(0) < LE Then
LE = LatestEntryPrice(0);
if SL <= EntryPrice-PriceScale*익절1 then{
ExitShort("S익절1",AtStop,SL+(EntryPrice-SL)*익절1하락퍼센트); }
}
2020-03-05
360
글번호 136594
시스템
답변완료
추가 부탁드립니다.
안녕하세요?
아래의 수식에서 이평선2개(각각 외부변수)를 넣어서 정배열에서 매도, 역배열에서 매수가 되도록 부탁드립니다.
감사합니다.
input : 매수음봉틱수(5),매수양봉틱수(5);
input : 매도양봉틱수(5),매도음봉틱수(5);
input : 진입횟수(5);
input : 익절틱수(50),손절틱수(50);
var : entry(0);
#영업일 변경
if bdate != bdate[1] Then
entry = 0;
#포지션이 변경되어 새로운 진입포지션 발생시마다 1씩 증가
if MarketPosition != 0 and MarketPosition != MarketPosition[1] Then
entry = entry+1;
if entry < 진입횟수 and #진입횟수가 지정한 값 이하
MarketPosition == 0 and #매수나 무포지션 상태
C[1] == O[1]+매도양봉틱수*PriceScale and #1봉전종가가 1봉전시가+매도양봉틱수 이상
C[0] == O[0]-매도음봉틱수*PriceScale Then #현재봉 종가가 1봉전시가-매도음봉틱수 이하
sell("s");
if entry < 진입횟수 and #진입횟수가 지정한 값 이하
MarketPosition == 0 and #매도나 무포지션 상태
C[1] == O[1]-매수음봉틱수*PriceScale and #1봉전종가가 1봉전시가-매수음봉틱수 이하
C[0] == O[0]+매수양봉틱수*PriceScale Then #현재봉 종가가 1봉전시가+매수양봉틱수 이상
buy("b");
#매수진입 후 손절되면 매도로 스위칭
if MarketPosition == 1 Then
sell("bs",AtStop,EntryPrice-PriceScale*손절틱수);
#매도진입 후 손절되면 매수로 스위칭
if MarketPosition == -1 Then
buy("sb",AtStop,EntryPrice+PriceScale*손절틱수);
#목표수익 설정
SetStopProfittarget(PriceScale*익절틱수,PointStop);
2020-03-05
370
글번호 136593
시스템