커뮤니티
수식 부탁합니다.
2013-11-11 10:35:21
146
글번호 69371
안녕하세요?
선물데이트레이딩이며 새로운 매수청산 매도청산식을 만들려고 합니다.
Dailyvol = (Dayhigh(1)-Daylow(1));
상단채널 = Dayopen+Dailyvol*0.5;
하단채널 = Dayopen-Dailyvol*0.5;
StoK = StochasticsK(20,5);
If Crossup(C,상단채널) and Bids>Asks then {Buy("매수1"); var1==stok and condition1 == true;}
If Crossdown(C,하단채널) and Bids<Asks then {Sell("매도1"); var2=stok and condition2 ==true;}
If Crossup(C,상단채널) and adx(5)>adx(50[1] and adx(5) >50 then Buy("매수2");
If Crossdown(C,하단채널) and adx(5)>adx(50[1] and adx(5) >50 then Sell("매도2");
If Marketposition ==1 then Exitlong("매수청산1",atstop,Highest(H,barssinceentry+1) -atr(20) *3); /// 매수1, 매수2 공통청산
If Marketposition ==-1 then Exitshort("매도청산1",atstop,Lowest(L,barssinceentry+1) +atr(20) *3); /// 매도1, 매도2 공통청산
매수1과 매도1에 해당하는 청산식을 만들려고 합니다. 매수1 발생시의 stoK값을 저장해서 stoK값이 상승후 하락시 stoK저장값보다 작으면 청산,
매도1 발생시의 stoK값을 저장해서 stoK값이 하락후 상승시 stoK저장값보다 크면 청산하려고 하는데 수식을 알고싶습니다. 아래수식이 맞는지 확인해 주시면 고맙겠습니다.
If marketposition==1 and IsEntryName("매수1",0) == True and Condition1 == False and stok < Var1 Then
Exitlong("매수청산2", AtStop, highest(h,BarsSinceEntry +1) - stok);
If marketposition==-1 and IsEntryName("매도1",0) == True and Condition2 == False and stok > Var1 Then
Exitsort("매도청산2", AtStop, lowest(l,BarsSinceEntry +1) + stok);
답변 1
예스스탁 예스스탁 답변
2013-11-12 10:02:34
안녕하세요
예스스탁입니다.
var : Dailyvol(0),상단채널(0),하단채널(0),StoK(0);
Dailyvol = (Dayhigh(1)-Daylow(1));
상단채널 = Dayopen+Dailyvol*0.5;
하단채널 = Dayopen-Dailyvol*0.5;
StoK = StochasticsK(20,5);
If MarketPosition <= 0 and Crossup(C,상단채널) and Bids>Asks then{
Buy("매수1");
var1 = stok;
}
If MarketPosition >= 0 and Crossdown(C,하단채널) and Bids<Asks then {
Sell("매도1");
var2 = stok;
}
If MarketPosition <= 0 and Crossup(C,상단채널) and adx(5)>adx(5)[1] and adx(5) >50 then
Buy("매수2");
If MarketPosition >= 0 and Crossdown(C,하단채널) and adx(5)>adx(5)[1] and adx(5) >50 then
Sell("매도2");
If Marketposition ==1 then Exitlong("매수청산1",atstop,Highest(H,barssinceentry+1) -atr(20) *3); /// 매수1, 매수2 공통청산
If Marketposition ==-1 then Exitshort("매도청산1",atstop,Lowest(L,barssinceentry+1) +atr(20) *3); /// 매도1, 매도2 공통청산
if MarketPosition == 1 and IsEntryName("매수1",0) == true and CrossDown(stok,var1) and stok[1] > var1 Then
exitlong("매수청산2");
if MarketPosition == -1 and IsEntryName("매도1",0) == true and CrossUp(stok,var2) and stok[1] < var2 Then
ExitShort("매도청산2");
즐거운 하루되세요
> 함밝중명 님이 쓴 글입니다.
> 제목 : 수식 부탁합니다.
> 안녕하세요?
선물데이트레이딩이며 새로운 매수청산 매도청산식을 만들려고 합니다.
Dailyvol = (Dayhigh(1)-Daylow(1));
상단채널 = Dayopen+Dailyvol*0.5;
하단채널 = Dayopen-Dailyvol*0.5;
StoK = StochasticsK(20,5);
If Crossup(C,상단채널) and Bids>Asks then {Buy("매수1"); var1==stok and condition1 == true;}
If Crossdown(C,하단채널) and Bids<Asks then {Sell("매도1"); var2=stok and condition2 ==true;}
If Crossup(C,상단채널) and adx(5)>adx(50[1] and adx(5) >50 then Buy("매수2");
If Crossdown(C,하단채널) and adx(5)>adx(50[1] and adx(5) >50 then Sell("매도2");
If Marketposition ==1 then Exitlong("매수청산1",atstop,Highest(H,barssinceentry+1) -atr(20) *3); /// 매수1, 매수2 공통청산
If Marketposition ==-1 then Exitshort("매도청산1",atstop,Lowest(L,barssinceentry+1) +atr(20) *3); /// 매도1, 매도2 공통청산
매수1과 매도1에 해당하는 청산식을 만들려고 합니다. 매수1 발생시의 stoK값을 저장해서 stoK값이 상승후 하락시 stoK저장값보다 작으면 청산,
매도1 발생시의 stoK값을 저장해서 stoK값이 하락후 상승시 stoK저장값보다 크면 청산하려고 하는데 수식을 알고싶습니다. 아래수식이 맞는지 확인해 주시면 고맙겠습니다.
If marketposition==1 and IsEntryName("매수1",0) == True and Condition1 == False and stok < Var1 Then
Exitlong("매수청산2", AtStop, highest(h,BarsSinceEntry +1) - stok);
If marketposition==-1 and IsEntryName("매도1",0) == True and Condition2 == False and stok > Var1 Then
Exitsort("매도청산2", AtStop, lowest(l,BarsSinceEntry +1) + stok);