답변완료
문의 드립니다.
1. 항셍(오전 10시 18분 ~ 오전 11시 40분), 나스닥(22시 30분 ~ 01시 10분) 골드(21시 ~22시 10분) 거래시간 지정
2. 매도신호가 나오는 캔들의 종가에 매도. 음봉일 때만 매도(양봉일 때는 안함)
3. 매수신호가 나오는 캔들의 종가에 매수. 양봉일 때만 매수(음봉일 때는 안함)
4. 매수와 매도, 모두1계약을 진입합니다.
항셍 10시 18분 ~ 10시 30분까지는 익절 30틱, 손절 30틱 / 10시 30분 ~ 11시 40분까지는 익절 50틱, 손절 30틱.
나스닥은 오후 22시 30분 ~ 01시 10분까지 익절 50틱, 손절 30틱
골드는 오후 21시 ~ 22시 10분까지 익절 20틱, 손절 15틱
5. 거래시간 종료시에 포지션이 있을 경우 수식에 따라 익절 또는 손절 종료함.
6. 익절 3회 연속, 또는 손절 3회 연속이면 당일 거래 종료.
아래에 수식은 일전에 문의한 것에 대해 답을 해주신 것입니다.
위 내용에 대한 수식으로의 변경을 할 경우, 추가나 수정해야 할 부분이 헷갈려서요. 답변 부탁드립니다.
늘 친절히 답변해주심에 감사드립니다.
input : StartTime(101500),EndTime(120000);
input : Length(20), D1(2);
var : Tcond(false);
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;
var1 = BollBandUp(Length,D1);
var2 = BollBandDown(Length,D1);
if Tcond == true Then
{
If CrossUP(H,var1) and c > o then
Buy("b",OnClose,DEF,2);
If CrossDown(L,Var2) and C < O then
Sell("s",OnClose,DEF,2);
}
if MarketPosition == 1 Then
{
ExitLong("Bp1",AtLimit,EntryPrice+PriceScale*50,"",1,1);
ExitLong("Bp2",AtLimit,EntryPrice+PriceScale*100,"",1,1);
ExitLong("Bl",AtStop,EntryPrice-PriceScale*3,"",1,1);
if CurrentContracts < MaxContracts and Highest(H,BarsSinceEntry) > EntryPrice+PriceScale*50 Then
ExitLong("btr",AtStop,EntryPrice+PriceScale*10);
}
if MarketPosition == -1 Then
{
ExitShort("sp1",AtLimit,EntryPrice-PriceScale*50,"",1,1);
ExitShort("sp2",AtLimit,EntryPrice-PriceScale*100,"",1,1);
ExitShort("sl",AtStop,EntryPrice+PriceScale*3,"",1,1);
if CurrentContracts < MaxContracts and lowest(L,BarsSinceEntry) < EntryPrice-PriceScale*50 Then
ExitShort("str",AtStop,EntryPrice+PriceScale*10);
}
IF Endtime > starttime Then
SetStopEndofday(Endtime);
Else
{
if sDate != sDate[1] Then
SetStopEndofday(Endtime);
}
if (sdate != sdate[1] and stime >= StartTime) or
(sdate == sdate[1] and stime >= StartTime and stime[1] < StartTime) Then
{
IF Endtime <= starttime Then
{
SetStopEndofday(0);
}
}
2
24시는 0시 입니다.
input : StartTime(223000),EndTime(0);
input : Length(20), D1(2);
var : Tcond(false);
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;
var1 = BollBandUp(Length,D1);
var2 = BollBandDown(Length,D1);
if Tcond == true Then
{
If CrossUP(H,var1) and c > o then
Buy("b",OnClose,DEF,2);
If CrossDown(L,Var2) and C < O then
Sell("s",OnClose,DEF,2);
}
if MarketPosition == 1 Then
{
ExitLong("Bp1",AtLimit,EntryPrice+PriceScale*50,"",1,1);
ExitLong("Bp2",AtLimit,EntryPrice+PriceScale*100,"",1,1);
ExitLong("Bl",AtStop,EntryPrice-PriceScale*3,"",1,1);
if CurrentContracts < MaxContracts and Highest(H,BarsSinceEntry) > EntryPrice+PriceScale*50 Then
ExitLong("btr",AtStop,EntryPrice+PriceScale*10);
}
if MarketPosition == -1 Then
{
ExitShort("sp1",AtLimit,EntryPrice-PriceScale*50,"",1,1);
ExitShort("sp2",AtLimit,EntryPrice-PriceScale*100,"",1,1);
ExitShort("sl",AtStop,EntryPrice+PriceScale*3,"",1,1);
if CurrentContracts < MaxContracts and lowest(L,BarsSinceEntry) < EntryPrice-PriceScale*50 Then
ExitShort("str",AtStop,EntryPrice+PriceScale*10);
}
IF Endtime > starttime Then
SetStopEndofday(Endtime);
Else
{
if sDate != sDate[1] Then
SetStopEndofday(Endtime);
}
if (sdate != sdate[1] and stime >= StartTime) or
(sdate == sdate[1] and stime >= StartTime and stime[1] < StartTime) Then
{
IF Endtime <= starttime Then
{
SetStopEndofday(0);
}
}
2021-10-07
1254
글번호 152745
시스템
답변완료
이격도 수식인데 수정 및 검수 부탁드림니다.
현 사용 수식 입니다.
이격도 매수값이 다른 수식 3개을 사용중입니다.
같은 나스닥 60분봉차트에 이격도 매수값 93 일때 96 일 때 98일때 (나머지 변수는 동일)
차트를 3개를 띄어서 적용하고 있는데요
한차트에 이격도매수값만 다른식들을 반영될수 있을까요???
예를들면 이격도 93 , 94, 95, 96, 97, 98 일때 적용되는 수식입니다.
원래 이렇게 하려면 6개 수식을 만들고 6개 차트를 열고 입력해야하는데요
그것을 하나의 수식과 하나의 차트로 적용될수 있게 수식 변경 부탁드릴께요~~~~
--- 기존 이격도 매수값(96)인 수식임 --------
# 나스닥 60분봉 차트 이격도 매수 진입 청산 버전 20210930
input : 이격도기간(50),이격도매수값(96),
input : 이격도청산값(100.5),하락틱수(300),손절틱수(500);
input : 추가매수횟수(2);
var1 = Disparity(이격도기간);
if MarketPosition == 0 and var1 < 이격도매수값 and V > V[1] and C < C[1] Then
Buy("b",OnClose,DEf,1);
if MarketPosition == 1 and MaxEntries < 추가매수횟수 Then
Buy("bb",AtLimit,LatestEntryPrice(0)-PriceScale*하락틱수);
if MarketPosition == 1 and var1 > 이격도청산값 Then
ExitLong("bx");
SetStopLoss(PriceScale*손절틱수,PointStop);
2021-10-07
897
글번호 152729
시스템