예스스탁
예스스탁 답변
2019-11-08 15:08:42
안녕하세요
예스스탁입니다.
1
input : up진입수(1), dn진입수(1);
input : uppyra검증(0.20);
input : 상승pyra(0.00),상승N(6);
input : dnpyra검증(0.20);
input : 하락pyra(0.00),하락N(6);
input : up강제손절(0.60),dn강제손절(0.60);
var : S1(0),S2(0),ST(0),E1(0),E2(0),ET(0),second(0);
var : T1(0),entry(0),Bloss(0),Sloss(0);
if bdate != Bdate[1] Then
T1 = TotalTrades;
if MarketPosition == 0 Then
entry = TotalTrades-T1;
Else
entry = TotalTrades-T1+1;
S1 = TimeToMinutes(stime)*60;
S2 = FracPortion(stime/100)*100;
ST = S1+S2;
E1 = TimeToMinutes(time)*60;
E2 = FracPortion(time/100)*100;
ET = E1+E2;
if sdate == date Then
Second = ET-ST;
Else
Second = 86400-ST+ET;
if entry < up진입수 and second < second[1] and C > O Then
buy("b1");
if entry < dn진입수 and second < second[1] and C < O Then
sell("s1");
if MarketPosition == 1 then
{
if CurrentContracts <= MaxContracts-(상승N*0.5) Then
Condition1 = true;
if C >= EntryPrice+uppyra검증 and MaxContracts < 상승N Then
{
if Condition1 == false then
buy("bb",AtStop,LatestEntryPrice(0)+상승Pyra);
}
}
Else
Condition1 = false;
if MarketPosition == -1 then
{
if CurrentContracts <= MaxContracts-(하락N*0.5) Then
Condition2 = true;
if C <= EntryPrice-dnpyra검증 and MaxContracts < 하락N Then
{
if Condition2 == false then
sell("ss",AtStop,LatestEntryPrice(0)-하락Pyra);
}
}
Else
Condition2 = false;
if MarketPosition == 1 Then
{
SetStopLoss(up강제손절,pointstop);
}
if MarketPosition == -1 Then
{
SetStopLoss(dn강제손절,pointstop);
}
2
input : up진입수(1), dn진입수(1);
input : uppyra검증(0.20);
input : 상승pyra(0.00),상승N(6);
input : dnpyra검증(0.20);
input : 하락pyra(0.00),하락N(6);
input : up강제손절(0.60),dn강제손절(0.60);
var : S1(0),S2(0),ST(0),E1(0),E2(0),ET(0),second(0);
var : T1(0),entry(0),Bentry(0),Sentry(0);
if bdate != Bdate[1] Then
T1 = TotalTrades;
if MarketPosition == 0 Then
entry = TotalTrades-T1;
Else
entry = TotalTrades-T1+1;
S1 = TimeToMinutes(stime)*60;
S2 = FracPortion(stime/100)*100;
ST = S1+S2;
E1 = TimeToMinutes(time)*60;
E2 = FracPortion(time/100)*100;
ET = E1+E2;
if sdate == date Then
Second = ET-ST;
Else
Second = 86400-ST+ET;
if entry < up진입수 and second < second[1] and C > O Then
buy("b1");
if entry < dn진입수 and second < second[1] and C < O Then
sell("s1");
if MarketPosition == 1 then
{
if CurrentContracts > CurrentContracts[1] Then
Bentry = Bentry+1;
if C >= EntryPrice+uppyra검증 and Bentry < 상승N Then
{
buy("bb",AtStop,LatestEntryPrice(0)+상승Pyra);
}
}
Else
Bentry = false;
if MarketPosition == -1 then
{
if CurrentContracts > CurrentContracts[1] Then
Sentry = Sentry+1;
if C <= EntryPrice-dnpyra검증 and Sentry < 하락N Then
{
sell("ss",AtStop,LatestEntryPrice(0)-하락Pyra);
}
}
Else
Sentry = 0;
if MarketPosition == 1 Then
{
SetStopLoss(up강제손절,pointstop);
}
if MarketPosition == -1 Then
{
SetStopLoss(dn강제손절,pointstop);
}
즐거운 하루되세요
> 좌오비우오비 님이 쓴 글입니다.
> 제목 : 문의
> 별첨파일은 아래수식을 시뮬레이션한 결과입니다.
피라미딩은 max 6개되는 수식입니다.
2017년5월29일을 보면
buy 진입 후 피라미딩을 3개까지(잔고 4개) 하다가
9시05분 2번째,3번째,4번째가 손절로 청산된 후(잔고1개)
9시22분 다시 피라미딩을 하여 max6개를 채웁니다.
요청사항
1) 피라미딩 max n개의 50% 이상 손절될 경우는 피라미딩 중지
위 경우처럼 3개 손절되면 피라미딩 중지. 잔고1개로 포지션 유지.
2) 피라미딩 max에서 손절되는 갯수를 제한 나머지 숫자가 피라미딩 max가 됨
위 경우처럼 3개 손절되면 max 피라미딩은 3개까지 허용.
두 가지 경우를 나누어 요청드립니다.
*************************************************************
input : up진입수(1), dn진입수(1);
input : uppyra검증(0.20);
input : 상승pyra(0.00),상승N(6);
input : dnpyra검증(0.20);
input : 하락pyra(0.00),하락N(6);
input : up강제손절(0.60),dn강제손절(0.60);
var : S1(0),S2(0),ST(0),E1(0),E2(0),ET(0),second(0);
var : T1(0),entry(0);
if bdate != Bdate[1] Then
T1 = TotalTrades;
if MarketPosition == 0 Then
entry = TotalTrades-T1;
Else
entry = TotalTrades-T1+1;
S1 = TimeToMinutes(stime)*60;
S2 = FracPortion(stime/100)*100;
ST = S1+S2;
E1 = TimeToMinutes(time)*60;
E2 = FracPortion(time/100)*100;
ET = E1+E2;
if sdate == date Then
Second = ET-ST;
Else
Second = 86400-ST+ET;
if entry < up진입수 and second < second[1] and C > O Then
buy("b1");
if entry < dn진입수 and second < second[1] and C < O Then
sell("s1");
if MarketPosition == 1 and C >= EntryPrice+uppyra검증 and MaxContracts < 상승N Then
buy("bb",AtStop,LatestEntryPrice(0)+상승Pyra);
if MarketPosition == -1 and C <= EntryPrice-dnpyra검증 and MaxContracts < 하락N Then
sell("ss",AtStop,LatestEntryPrice(0)-하락Pyra);
if MarketPosition == 1 Then
{
SetStopLoss(up강제손절,pointstop);
}
if MarketPosition == -1 Then
{
SetStopLoss(dn강제손절,pointstop);
}