답변완료
수식어 부탁드립니다
input : StartTime(150000),EndTime(055000);
Input : 당일수익틱수(120);
var : 전환선(0),기준선(0),선행스팬1(0),선행스팬2(0);
var : Tcond(false);
Var : N1(0),dayPl(0),당일수익(0),Xcond(false);
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;
Xcond = false;
N1 = NetProfit;
SetStopEndofday(0);
}
당일수익 = PriceScale*당일수익틱수;
daypl = NetProfit-N1;
if TotalTrades > TotalTrades[1] then
{
if daypl >= 당일수익 Then
Xcond = true;
if IsExitName("dbp",1) == true or IsExitName("dsp",1) == true then
Xcond = true;
}
전환선 = (highest(H,9)+lowest(L,9))/2;
기준선 = (highest(H,26)+lowest(L,26))/2;
선행스팬1 = (전환선[25]+기준선[25])/2;
선행스팬2 = (highest(H,52)[25]+lowest(L,52)[25])/2;
var1 = Disparity(20);
if Tcond == true and xcond == False Then
{
if 전환선 > 기준선 and crossup(전환선,선행스팬1) and var1 >= 99 Then
buy("b");
if MarketPosition == 1 then
{
ExitLong("dbp",atlimit,EntryPrice+((당일수익-daypl)/CurrentContracts));
if 전환선 < 기준선 and CrossDown(전환선,선행스팬2) and var1 >= 99 Then
exitlong();
}
if 전환선 < 기준선 and CrossDown(전환선,선행스팬1) and var1 <= 101 Then
sell("s");
if MarketPosition == -1 then
{
ExitShort("dsp",atlimit,EntryPrice-((당일수익-daypl)/CurrentContracts));
if 전환선 > 기준선 and CrossUp(전환선,선행스팬2) and var1 <= 101 Then
ExitShort();
}
}
------------------------------------------------------------------------
input : StartTime(070000),EndTime(055500);
input : BuyN(40),SellN(80),당일수익틱수(120);;
var : Tcond(false),N1(0),dayPl(0),당일수익(0),Xcond(false);
당일수익 = PriceScale*당일수익틱수;
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
{
var1 = O;
Tcond = true;
Xcond = false;
N1 = NetProfit;
SetStopEndofday(0);
}
daypl = NetProfit-N1;
if TotalTrades > TotalTrades[1] then
{
if daypl >= 당일수익 Then
Xcond = true;
if IsExitName("dbp",1) == true or IsExitName("dsp",1) == true then
Xcond = true;
}
if Tcond == true and Xcond == False Then
{
if MarketPosition <= 0 and L >= DayOpen-20*PriceScale Then
Buy("b",AtLimit,DayOpen-20*PriceScale);
if MarketPosition <= 0 and L >= DayOpen-30*PriceScale Then
Sell("s",AtLimit,DayOpen+30*PriceScale);
}
if MarketPosition == 1 Then
{
ExitLong("dbp",atlimit,EntryPrice+((당일수익-daypl)/CurrentContracts));
SetStopProfittarget(PriceScale*BuyN,PointStop);
SetStopLoss(PriceScale*BuyN,PointStop);
}
Else if MarketPosition == -1 Then
{
ExitShort("dsp",atlimit,EntryPrice-((당일수익-daypl)/CurrentContracts));
SetStopProfittarget(PriceScale*SellN,PointStop);
SetStopLoss(PriceScale*SellN,PointStop);
}
Else
{
SetStopProfittarget(0);
SetStopLoss(0);
}
------------------------------------------
상기 2개의 수식어를 하나의 수식어로 부탁드립니다.
매매시간은 07:00 익일 05:50이고 청산시간은 05:55 입니다.
목표수익은 120틱 입니다.
2021-04-09
716
글번호 147835
시스템
답변완료
부탁드립니다
$,안녕하세요.
국내선물에서 20틱을1포인트라 기준하고 아래조건Text 출력요청드립니다.
1,전일시가대비 당일시가의 상승,하락률을 상승은(Red),하락은(Blue)로 소숫점 2자리
까지 포인트로 차트우측상단에 출력하고
2,시가기준으로 저점대비율과 고점대비율을 1번과 같이 포인트로 실시간 출력 부탁
드립니다.(Text출력위치는 1번아래)
#,도움주심에 미리 감사드립니다.
2021-04-09
961
글번호 147833
지표
답변완료
수식 좀 도와주세요~
안녕하세요.
Var1= ma(close,len1);
Var2= ma(close,len2);
Var3= ma(close,len3);
value1=CCI(CLen1);
value2=CCI(CLen2);
value3=CCI(CLen3);
value4=CCI(CLen4);
If Var1>var2 And value1>value2 Then
buy("매수");
If Var1<var2 And value3<value4 Then
sell("매도");
위와 같은 전략식의 경우,
매수로 진입 후 지수가 큰폭으로 하락하여 계속 손실은 보고있는데,
아직 매도로 포지션은 안바뀌고 있고, 이럴때 마음이 편치않은데요,
손실폭을 줄이기 위해서 아래와 같은 조건을 넣을 수 있는지요?
매수 진입 후 지수가 ( ) point 하락하면 일단 청산.
- 계속 하락하여 매도 조건이 되면 매도
- 매도 조건이 되기전에 도로 상승하여 매수 진입 조건에 도달하면 다시 매수.
반대의 경우도 있겠죠.
매도 진입 후 지수가 ( ) point 상승하면 청산.
- 계속 상승하여 매수 조건이 되면 매수.
- 매수 조건이 되기 전에 도로 하락하여 매도 진입 조건에 도달하면 다시 매도.
여기서 ( )point는 변수 처리.
수식으로 도와주시면 감사하겠습니다.
2021-04-08
776
글번호 147830
시스템