예스스탁
예스스탁 답변
2022-12-02 10:02:54
안녕하세요
예스스탁입니다.
SetStopProfittarget(PriceScale*익절틱수,PointStop);
SetStopLoss(PriceScale*손절틱수,PointStop);
현재 1번수식에는 익절 손절수식이 있습니다.
외부변수로 틱수 지정하게 되어 있습니다.
1번식에는 봉완성시 청산추가,
2번식에는 익절과 봉완성시 청산을 추가해 드립니다.
1
input : starttime(120000),endtime(60000),n(30);
var : Tcond(false),hh(0),h1(0),ll(0),l1(0);
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;
hh = h;
ll = l;
h1 = hh[1];
l1 = ll[1];
IF Endtime <= starttime Then
{
SetStopEndofday(0);
}
}
input : 익절틱수(160),손절틱수(30);
if NextBarOpen != C Then
{
Buy("b1",AtStop,NextBarOpen+PriceScale*10);
}
ExitLong("bx1",AtMarket);
if NextBarOpen != C Then
{
Sell("s1",AtStop,NextBarOpen-PriceScale*10);
}
ExitShort("sx1",AtMarket);
if NextBarSdate == sDate Then
{
if NextBarOpen == C Then
{
Buy("b2",AtStop,NextBarOpen+PriceScale*10);
}
}
ExitLong("bx2",AtMarket);
if NextBarOpen == C Then
{
Sell("s2",AtStop,NextBarOpen-PriceScale*10);
}
ExitShort("sx2",AtMarket);
SetStopProfittarget(PriceScale*익절틱수,PointStop);
SetStopLoss(PriceScale*손절틱수,PointStop);
ExitLong("bx");
ExitShort("sx");
2
input : starttime(120000),endtime(60000),n(0);
input : 익절틱수(160);
var1 = c-o;
Var2 = AccumN(var1,5);
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
{
IF Endtime <= starttime Then
{
SetStopEndofday(0);
}
}
if Var2 > 0 Then
Buy();
if var2 < 0 Then
Sell();
SetStopProfittarget(PriceScale*익절틱수,PointStop);
ExitLong("bx");
ExitShort("sx");
즐거운 하루되세요
> 푸른 님이 쓴 글입니다.
> 제목 : 문의 드립니다
> 1.
input : starttime(120000),endtime(60000),n(30);
var : Tcond(false),hh(0),h1(0),ll(0),l1(0);
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;
hh = h;
ll = l;
h1 = hh[1];
l1 = ll[1];
IF Endtime <= starttime Then
{
SetStopEndofday(0);
}
}
input : 익절틱수(0),손절틱수(30);
if NextBarOpen != C Then
{
Buy("b1",AtStop,NextBarOpen+PriceScale*10);
}
ExitLong("bx1",AtMarket);
if NextBarOpen != C Then
{
Sell("s1",AtStop,NextBarOpen-PriceScale*10);
}
ExitShort("sx1",AtMarket);
if NextBarSdate == sDate Then
{
if NextBarOpen == C Then
{
Buy("b2",AtStop,NextBarOpen+PriceScale*10);
}
}
ExitLong("bx2",AtMarket);
if NextBarOpen == C Then
{
Sell("s2",AtStop,NextBarOpen-PriceScale*10);
}
ExitShort("sx2",AtMarket);
SetStopProfittarget(PriceScale*익절틱수,PointStop);
SetStopLoss(PriceScale*손절틱수,PointStop);
-------------------------
2.
var1 = c-o;
Var2 = AccumN(var1,5);
input : starttime(120000),endtime(60000),n(0);
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
{
IF Endtime <= starttime Then
{
SetStopEndofday(0);
}
}
if Var2 > 0 Then
Buy();
if var2 < 0 Then
Sell();
위 2가지 수식어를 240분봉 매매 자료로 사용하고 있습니다.
진입후 160틱 익절이나 240분봉의 완성시 청산되는 수식어를 추가할 수 없는지요 ?
강제청산 설정에서 최대 수익대비 하락설정을 하게 되면 익절의 폭이 적게 나와서
질문 드려봅니다.