답변완료
문의드립니다.
감사합니다.
아래수식 수정해주시면 감사하겠습니다.
아래 수식에 강제청산 200틱 손절을 포함해주시고,
강제청산후 다음 진입신호가 같은 방향이면 진입하지 않고, 3번째 진입신호부터는 같은방향도 진입가능하게 부탁드립니다.
강제청산후 다음 진입신호가 다른 방향이면 무조건 진입가능 합니다.
감사합니다....
input : StartTime(83000),EndTime(65000);
Input : rsiP(9),과매수(80),과매도(20),maP(120);
var : RSIV(0),mav(0);
var : Tcond(false);
RSIV = RSI(rsiP);
mav = ma(c,mav);
IF Endtime > starttime Then
SetStopEndofday(Endtime);
Else
{
if sDate != sDate[1] Then
SetStopEndofday(Endtime);
}
if (sdate != sdate[1] and stime >= EndTime) or
(sdate == sdate[1] and stime >= EndTime and stime[1] < EndTime) Then
Tcond = False;
if (sdate != sdate[1] and stime >= StartTime) or
(sdate == sdate[1] and stime >= StartTime and stime[1] < StartTime) Then
{
Tcond = true;
IF Endtime <= starttime Then
{
SetStopEndofday(0);
}
}
if Tcond == true Then
{
if MarketPosition >= 0 and CrossUp(RSIV,과매수) and IsExitName("sx1",1) == False Then
Sell("s");
if MarketPosition == -1 Then
{
if CountIf(CrossUp(RSIV,과매수),BarsSinceEntry) == 4 Then
ExitShort("sx1");
if CrossUp(C,mav) Then
ExitShort("sx2");
}
if MarketPosition <= 0 and CrossDown(RSIV,과매도) and IsExitName("bx1",1) == False Then
Buy();
if MarketPosition == 1 Then
{
if CountIf(CrossDown(RSIV,과매도),BarsSinceEntry) == 4 Then
ExitLong("bx1");
if CrossDown(C,mav) Then
ExitShort("bx2");
}
}
2022-09-07
952
글번호 162077
시스템
답변완료
안녕하세요
안녕하세요
1.
아래 수식은 진입가 대비 10% 수익시 1계약 청산식입니다.
진입한(보유) 수량의 % 비율로 청산수식을 수정부탁드립니다.
예시는 보유 수량의 50%씩 두번 분할청산 되는 수식으로 부탁드려요.
ExitLong("bp1",AtLimit,EntryPrice*1.1,def,10);
2.
아래 수식으로 손절을 하는데요 분할진입시 익절,손절이 개별 진입시점기준으로 분산됨니다.
ex) 손절 1%예시
1차 진입가 100 일때 99 손절 , 2차 진입가 200 일때 198 손절
손절도 분할로 익절도 동일하게 분할 처리 됨니다.
익절,손절을 평균가로 하는 예제수식 부탁드립니다.
LC(손절변수)
SetStopLoss(LC,PercentStop);
-----------------------------------------------------------------
If MarketPosition <= 0 and value1 == 1 and Condition1 == true Then
Buy("B1",AtStop,고[2,1]-PriceScale*a,1);
if MarketPosition == 1 Then
{
if L > EntryPrice*0.99 Then
Buy("bb2",AtLimit,EntryPrice*0.99,1);
if L > EntryPrice*0.98 Then
Buy("bb3",AtLimit,EntryPrice*0.98,1);
if L > EntryPrice*0.97 Then
Buy("bb4",AtLimit,EntryPrice*EntryPrice*0.97,1);
if L > EntryPrice*0.96 Then
Buy("bb5",AtLimit,EntryPrice*EntryPrice*0.96,1);
}
if MarketPosition == 1 Then
{
if H < EntryPrice*1.02 Then
ExitLong("bp1",AtLimit,EntryPrice*1.02,def,1);
if H < EntryPrice*1.04 Then
ExitLong("bp2",AtLimit,EntryPrice*1.04,def,1);
if H < EntryPrice*1.06 Then
ExitLong("bp3",AtLimit,EntryPrice*1.06,def,1);
if H < EntryPrice*1.08 Then
ExitLong("bp4",AtLimit,EntryPrice*1.08,def,1);
if H < EntryPrice*1.10 Then
ExitLong("bp5",AtLimit,EntryPrice*1.10,def,1);
}
SetStopLoss(LC,PercentStop);
감사합니다.
2022-09-07
1214
글번호 162051
시스템
답변완료
문의 드립니다
input : 익절틱수(160),손절틱수(30);
var1 = ma(C,10);
Var2 = ma(C,1);
if NextBarSdate != sDate and var1 > Var2 Then
{
if NextBarOpen > C Then
Buy("b",AtStop,NextBarOpen+PriceScale*-20);
if NextBarOpen < C Then
Buy("bx",AtStop,NextBarOpen-PriceScale*-20);
}
SetStopProfittarget(PriceScale*익절틱수,PointStop);
SetStopLoss(PriceScale*손절틱수,PointStop);
var1 = ma(C,5);
Var2 = ma(C,1);
if NextBarSdate != sDate and var1 > Var2 Then
{
if NextBarOpen > C Then
Buy("b1",AtStop,NextBarOpen+PriceScale*-20);
if NextBarOpen < C Then
Buy("bx1",AtStop,NextBarOpen-PriceScale*-20);
}
SetStopProfittarget(PriceScale*익절틱수,PointStop);
SetStopLoss(PriceScale*손절틱수,PointStop);
var1 = ma(C,4);
Var2 = ma(C,1);
if NextBarSdate != sDate and var1 > Var2 Then
{
if NextBarOpen > C Then
Buy("b2",AtStop,NextBarOpen+PriceScale*-20);
if NextBarOpen < C Then
Buy("bx2",AtStop,NextBarOpen-PriceScale*-20);
}
SetStopProfittarget(PriceScale*익절틱수,PointStop);
SetStopLoss(PriceScale*손절틱수,PointStop);
var1 = ma(C,1);
Var2 = ma(C,5);
if NextBarSdate != sDate and var1 > Var2 Then
{
if NextBarOpen > C Then
Buy("b3",AtStop,NextBarOpen+PriceScale*-20);
if NextBarOpen < C Then
Buy("bx3",AtStop,NextBarOpen-PriceScale*-20);
}
SetStopProfittarget(PriceScale*익절틱수,PointStop);
SetStopLoss(PriceScale*손절틱수,PointStop);
---------------
위 수식어에 60선 아래 진입신호금지를 추가 부탁드립니다.
-------------------------------------------------------------------
input : 익절틱수(120),손절틱수(30);
var1 = ma(C,1);
Var2 = ma(C,5);
if NextBarSdate != sDate and var1 < Var2 Then
{
if NextBarOpen > C Then
Sell("s",AtStop,NextBarOpen+PriceScale*-18);
if NextBarOpen < C Then
Sell("sx",AtStop,NextBarOpen-PriceScale*-18);
}
SetStopProfittarget(PriceScale*익절틱수,PointStop);
SetStopLoss(PriceScale*손절틱수,PointStop);
var1 = ma(C,3);
Var2 = ma(C,7);
if NextBarSdate != sDate and var1 < Var2 Then
{
if NextBarOpen > C Then
Sell("s1",AtStop,NextBarOpen+PriceScale*-18);
if NextBarOpen < C Then
Sell("sx1",AtStop,NextBarOpen-PriceScale*-18);
}
SetStopProfittarget(PriceScale*익절틱수,PointStop);
SetStopLoss(PriceScale*손절틱수,PointStop);
var1 = ma(C,5);
Var2 = ma(C,10);
if NextBarSdate != sDate and var1 < Var2 Then
{
if NextBarOpen > C Then
Sell("s2",AtStop,NextBarOpen+PriceScale*-18);
if NextBarOpen < C Then
Sell("sx2",AtStop,NextBarOpen-PriceScale*-18);
}
SetStopProfittarget(PriceScale*익절틱수,PointStop);
SetStopLoss(PriceScale*손절틱수,PointStop);
var1 = ma(C,7);
Var2 = ma(C,1);
if NextBarSdate != sDate and var1 < Var2 Then
{
if NextBarOpen > C Then
Sell("s3",AtStop,NextBarOpen+PriceScale*-18);
if NextBarOpen < C Then
Sell("sx3",AtStop,NextBarOpen-PriceScale*-18);
}
SetStopProfittarget(PriceScale*익절틱수,PointStop);
SetStopLoss(PriceScale*손절틱수,PointStop);
---------------------
위 수식어에 60선 위 진입신호금지를 추가 부탁드립니다.
2022-09-07
944
글번호 162049
시스템