예스스탁
예스스탁 답변
2022-11-08 10:41:23
안녕하세요
예스스탁입니다.
1
기존식에 endtime봉 완성시 청산식이 있었습니다.
해당내용 제거하고 6시 청산 추가해 드립니다.
input : starttime(140000),endtime(550000),n(30);
var : Tcond(false),hh(0),h1(0),ll(0),l1(0);
if Bdate != Bdate[1] Then
SetStopEndofday(060000);
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
{
SetStopEndofday(0);
Tcond = true;
hh = h;
ll = l;
h1 = hh[1];
l1 = ll[1];
}
if h > hh Then
hh = h;
if l < ll Then
ll = l;
if tcond == true and h1 > 0 and l1 > 0 then
{
if crossup(C,l1+(h1-l1)*1.000+PriceScale*n) Then
buy();
if crossup(C,l1-(h1-l1)*0.618+PriceScale*n) Then
buy();
if crossup(C,l1+(h1-l1)*0.500+PriceScale*n) Then
buy();
if crossup(C,l1+(h1-l1)*0.236+PriceScale*n) Then
buy();
if crossup(C,l1+(h1-l1)*0.000+PriceScale*n) Then
buy();
if CrossDown(C,l1+(h1-l1)*1.000-PriceScale*n) Then
sell();
if CrossDown(C,l1-(h1-l1)*0.618-PriceScale*n) Then
sell();
if CrossDown(C,l1+(h1-l1)*0.500-PriceScale*n) Then
sell();
if CrossDown(C,l1+(h1-l1)*0.236-PriceScale*n) Then
sell();
if CrossDown(C,l1+(h1-l1)*0.000-PriceScale*n) Then
sell();
}
if MarketPosition == 1 then
{
if crossup(c,h1+PriceScale*10) Then
exitlong();
if CrossDown(c,l1-PriceScale*10) Then
exitlong();
}
if MarketPosition == -1 then
{
if crossup(c,h1+PriceScale*10) Then
ExitShort();
if CrossDown(c,l1-PriceScale*10) Then
ExitShort();
}
2
input : starttime(90000),endtime(550000),n(30);
var : Tcond(false),hh(0),h1(0),ll(0),l1(0);
if (NextBarSdate != sdate and NextBarStime >= endtime) or
(NextBarSdate == sdate and NextBarStime >= endtime and stime < endtime) then
{
Tcond = false;
}
if (NextBarSdate != sdate and NextBarStime >= starttime) or
(NextBarSdate == sdate and NextBarStime >= starttime and NextBarStime < starttime) then
{
Tcond = true;
}
if tcond == true then
{
if NextBarSdate != sDate Then
{
if NextBarOpen > C Then
{
Buy("b2",AtStop,NextBarOpen+PriceScale*10);
Sell("s2",AtStop,NextBarOpen-PriceScale*10);
}
if NextBarOpen < C Then
{
ExitLong("bx2",AtStop,NextBarOpen-PriceScale*10);
ExitShort ("sx2",AtStop,NextBarOpen+PriceScale*10);
}
}
if MarketPosition > 1 Then
Sell("sss",AtStop,EntryPrice-10);
if MarketPosition < -1 Then
Buy("sss1",AtStop,EntryPrice+10);
if NextBarOpen > C Then
{
Buy("b3",AtStop,NextBarOpen+PriceScale*10);
Sell("s3",AtStop,NextBarOpen-PriceScale*10);
}
if NextBarOpen < C Then
{
ExitLong("bx3",AtStop,NextBarOpen-PriceScale*10);
ExitShort ("sx3",AtStop,NextBarOpen+PriceScale*10);
}
if MarketPosition > 1 Then
Sell("ssss",AtStop,EntryPrice-10);
if MarketPosition < -1 Then
Buy("ssss1",AtStop,EntryPrice+10);
if NextBarOpen > C Then
{
Buy("b4",AtStop,NextBarOpen+PriceScale*10);
Sell("s4",AtStop,NextBarOpen-PriceScale*10);
}
if NextBarOpen < C Then
{
ExitLong("bx4",AtStop,NextBarOpen-PriceScale*10);
ExitShort ("sx4",AtStop,NextBarOpen+PriceScale*10);
}
if MarketPosition > 1 Then
Sell("sssss",AtStop,EntryPrice-10);
if MarketPosition < -1 Then
Buy("sssss1",AtStop,EntryPrice+10);
}
즐거운 하루되세요
> 푸른 님이 쓴 글입니다.
> 제목 : 문의 드립니다.
> input : starttime(140000),endtime(550000),n(30);
var : Tcond(false),hh(0),h1(0),ll(0),l1(0);
if (sdate != sdate[1] and stime >= endtime) or
(sdate == sdate[1] and stime >= endtime and stime[1] < endtime) then
{
Tcond = false;
if MarketPosition == 1 Then
ExitLong("bx");
if MarketPosition == -1 Then
ExitShort("sx");
}
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 h > hh Then
hh = h;
if l < ll Then
ll = l;
if tcond == true and h1 > 0 and l1 > 0 then
{
if crossup(C,l1+(h1-l1)*1.000+PriceScale*n) Then
buy();
if crossup(C,l1-(h1-l1)*0.618+PriceScale*n) Then
buy();
if crossup(C,l1+(h1-l1)*0.500+PriceScale*n) Then
buy();
if crossup(C,l1+(h1-l1)*0.236+PriceScale*n) Then
buy();
if crossup(C,l1+(h1-l1)*0.000+PriceScale*n) Then
buy();
if CrossDown(C,l1+(h1-l1)*1.000-PriceScale*n) Then
sell();
if CrossDown(C,l1-(h1-l1)*0.618-PriceScale*n) Then
sell();
if CrossDown(C,l1+(h1-l1)*0.500-PriceScale*n) Then
sell();
if CrossDown(C,l1+(h1-l1)*0.236-PriceScale*n) Then
sell();
if CrossDown(C,l1+(h1-l1)*0.000-PriceScale*n) Then
sell();
}
if MarketPosition == 1 then
{
if crossup(c,h1+PriceScale*10) Then
exitlong();
if CrossDown(c,l1-PriceScale*10) Then
exitlong();
}
if MarketPosition == -1 then
{
if crossup(c,h1+PriceScale*10) Then
ExitShort();
if CrossDown(c,l1-PriceScale*10) Then
ExitShort();
}
위 수식어에 아침 06시00분에 강제청산되는식을 부탁드립니다.
--------------------------------------------
if NextBarSdate != sDate Then
{
if NextBarOpen > C Then
{
Buy("b2",AtStop,NextBarOpen+PriceScale*10);
Sell("s2",AtStop,NextBarOpen-PriceScale*10);
}
if NextBarOpen < C Then
{
ExitLong("bx2",AtStop,NextBarOpen-PriceScale*10);
ExitShort ("sx2",AtStop,NextBarOpen+PriceScale*10);
}
}
if MarketPosition > 1 Then
Sell("sss",AtStop,EntryPrice-10);
if MarketPosition < -1 Then
Buy("sss1",AtStop,EntryPrice+10);
if NextBarOpen > C Then
{
Buy("b3",AtStop,NextBarOpen+PriceScale*10);
Sell("s3",AtStop,NextBarOpen-PriceScale*10);
}
if NextBarOpen < C Then
{
ExitLong("bx3",AtStop,NextBarOpen-PriceScale*10);
ExitShort ("sx3",AtStop,NextBarOpen+PriceScale*10);
}
if MarketPosition > 1 Then
Sell("ssss",AtStop,EntryPrice-10);
if MarketPosition < -1 Then
Buy("ssss1",AtStop,EntryPrice+10);
if NextBarOpen > C Then
{
Buy("b4",AtStop,NextBarOpen+PriceScale*10);
Sell("s4",AtStop,NextBarOpen-PriceScale*10);
}
if NextBarOpen < C Then
{
ExitLong("bx4",AtStop,NextBarOpen-PriceScale*10);
ExitShort ("sx4",AtStop,NextBarOpen+PriceScale*10);
}
if MarketPosition > 1 Then
Sell("sssss",AtStop,EntryPrice-10);
if MarketPosition < -1 Then
Buy("sssss1",AtStop,EntryPrice+10);
매매시간 (09:00~ 익일 05:55) 추가를 부탁드립니다.
6시 청산이 되질않습니다
> 예스스탁 님이 쓴 글입니다.
> 제목 : Re : 문의 드립니다.
>
안녕하세요
예스스탁입니다.
1
기존식에 endtime봉 완성시 청산식이 있었습니다.
해당내용 제거하고 6시 청산 추가해 드립니다.
input : starttime(140000),endtime(550000),n(30);
var : Tcond(false),hh(0),h1(0),ll(0),l1(0);
if Bdate != Bdate[1] Then
SetStopEndofday(060000);
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
{
SetStopEndofday(0);
Tcond = true;
hh = h;
ll = l;
h1 = hh[1];
l1 = ll[1];
}
if h > hh Then
hh = h;
if l < ll Then
ll = l;
if tcond == true and h1 > 0 and l1 > 0 then
{
if crossup(C,l1+(h1-l1)*1.000+PriceScale*n) Then
buy();
if crossup(C,l1-(h1-l1)*0.618+PriceScale*n) Then
buy();
if crossup(C,l1+(h1-l1)*0.500+PriceScale*n) Then
buy();
if crossup(C,l1+(h1-l1)*0.236+PriceScale*n) Then
buy();
if crossup(C,l1+(h1-l1)*0.000+PriceScale*n) Then
buy();
if CrossDown(C,l1+(h1-l1)*1.000-PriceScale*n) Then
sell();
if CrossDown(C,l1-(h1-l1)*0.618-PriceScale*n) Then
sell();
if CrossDown(C,l1+(h1-l1)*0.500-PriceScale*n) Then
sell();
if CrossDown(C,l1+(h1-l1)*0.236-PriceScale*n) Then
sell();
if CrossDown(C,l1+(h1-l1)*0.000-PriceScale*n) Then
sell();
}
if MarketPosition == 1 then
{
if crossup(c,h1+PriceScale*10) Then
exitlong();
if CrossDown(c,l1-PriceScale*10) Then
exitlong();
}
if MarketPosition == -1 then
{
if crossup(c,h1+PriceScale*10) Then
ExitShort();
if CrossDown(c,l1-PriceScale*10) Then
ExitShort();
}
2
input : starttime(90000),endtime(550000),n(30);
var : Tcond(false),hh(0),h1(0),ll(0),l1(0);
if (NextBarSdate != sdate and NextBarStime >= endtime) or
(NextBarSdate == sdate and NextBarStime >= endtime and stime < endtime) then
{
Tcond = false;
}
if (NextBarSdate != sdate and NextBarStime >= starttime) or
(NextBarSdate == sdate and NextBarStime >= starttime and NextBarStime < starttime) then
{
Tcond = true;
}
if tcond == true then
{
if NextBarSdate != sDate Then
{
if NextBarOpen > C Then
{
Buy("b2",AtStop,NextBarOpen+PriceScale*10);
Sell("s2",AtStop,NextBarOpen-PriceScale*10);
}
if NextBarOpen < C Then
{
ExitLong("bx2",AtStop,NextBarOpen-PriceScale*10);
ExitShort ("sx2",AtStop,NextBarOpen+PriceScale*10);
}
}
if MarketPosition > 1 Then
Sell("sss",AtStop,EntryPrice-10);
if MarketPosition < -1 Then
Buy("sss1",AtStop,EntryPrice+10);
if NextBarOpen > C Then
{
Buy("b3",AtStop,NextBarOpen+PriceScale*10);
Sell("s3",AtStop,NextBarOpen-PriceScale*10);
}
if NextBarOpen < C Then
{
ExitLong("bx3",AtStop,NextBarOpen-PriceScale*10);
ExitShort ("sx3",AtStop,NextBarOpen+PriceScale*10);
}
if MarketPosition > 1 Then
Sell("ssss",AtStop,EntryPrice-10);
if MarketPosition < -1 Then
Buy("ssss1",AtStop,EntryPrice+10);
if NextBarOpen > C Then
{
Buy("b4",AtStop,NextBarOpen+PriceScale*10);
Sell("s4",AtStop,NextBarOpen-PriceScale*10);
}
if NextBarOpen < C Then
{
ExitLong("bx4",AtStop,NextBarOpen-PriceScale*10);
ExitShort ("sx4",AtStop,NextBarOpen+PriceScale*10);
}
if MarketPosition > 1 Then
Sell("sssss",AtStop,EntryPrice-10);
if MarketPosition < -1 Then
Buy("sssss1",AtStop,EntryPrice+10);
}
즐거운 하루되세요
> 푸른 님이 쓴 글입니다.
> 제목 : 문의 드립니다.
> input : starttime(140000),endtime(550000),n(30);
var : Tcond(false),hh(0),h1(0),ll(0),l1(0);
if (sdate != sdate[1] and stime >= endtime) or
(sdate == sdate[1] and stime >= endtime and stime[1] < endtime) then
{
Tcond = false;
if MarketPosition == 1 Then
ExitLong("bx");
if MarketPosition == -1 Then
ExitShort("sx");
}
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 h > hh Then
hh = h;
if l < ll Then
ll = l;
if tcond == true and h1 > 0 and l1 > 0 then
{
if crossup(C,l1+(h1-l1)*1.000+PriceScale*n) Then
buy();
if crossup(C,l1-(h1-l1)*0.618+PriceScale*n) Then
buy();
if crossup(C,l1+(h1-l1)*0.500+PriceScale*n) Then
buy();
if crossup(C,l1+(h1-l1)*0.236+PriceScale*n) Then
buy();
if crossup(C,l1+(h1-l1)*0.000+PriceScale*n) Then
buy();
if CrossDown(C,l1+(h1-l1)*1.000-PriceScale*n) Then
sell();
if CrossDown(C,l1-(h1-l1)*0.618-PriceScale*n) Then
sell();
if CrossDown(C,l1+(h1-l1)*0.500-PriceScale*n) Then
sell();
if CrossDown(C,l1+(h1-l1)*0.236-PriceScale*n) Then
sell();
if CrossDown(C,l1+(h1-l1)*0.000-PriceScale*n) Then
sell();
}
if MarketPosition == 1 then
{
if crossup(c,h1+PriceScale*10) Then
exitlong();
if CrossDown(c,l1-PriceScale*10) Then
exitlong();
}
if MarketPosition == -1 then
{
if crossup(c,h1+PriceScale*10) Then
ExitShort();
if CrossDown(c,l1-PriceScale*10) Then
ExitShort();
}
위 수식어에 아침 06시00분에 강제청산되는식을 부탁드립니다.
--------------------------------------------
if NextBarSdate != sDate Then
{
if NextBarOpen > C Then
{
Buy("b2",AtStop,NextBarOpen+PriceScale*10);
Sell("s2",AtStop,NextBarOpen-PriceScale*10);
}
if NextBarOpen < C Then
{
ExitLong("bx2",AtStop,NextBarOpen-PriceScale*10);
ExitShort ("sx2",AtStop,NextBarOpen+PriceScale*10);
}
}
if MarketPosition > 1 Then
Sell("sss",AtStop,EntryPrice-10);
if MarketPosition < -1 Then
Buy("sss1",AtStop,EntryPrice+10);
if NextBarOpen > C Then
{
Buy("b3",AtStop,NextBarOpen+PriceScale*10);
Sell("s3",AtStop,NextBarOpen-PriceScale*10);
}
if NextBarOpen < C Then
{
ExitLong("bx3",AtStop,NextBarOpen-PriceScale*10);
ExitShort ("sx3",AtStop,NextBarOpen+PriceScale*10);
}
if MarketPosition > 1 Then
Sell("ssss",AtStop,EntryPrice-10);
if MarketPosition < -1 Then
Buy("ssss1",AtStop,EntryPrice+10);
if NextBarOpen > C Then
{
Buy("b4",AtStop,NextBarOpen+PriceScale*10);
Sell("s4",AtStop,NextBarOpen-PriceScale*10);
}
if NextBarOpen < C Then
{
ExitLong("bx4",AtStop,NextBarOpen-PriceScale*10);
ExitShort ("sx4",AtStop,NextBarOpen+PriceScale*10);
}
if MarketPosition > 1 Then
Sell("sssss",AtStop,EntryPrice-10);
if MarketPosition < -1 Then
Buy("sssss1",AtStop,EntryPrice+10);
매매시간 (09:00~ 익일 05:55) 추가를 부탁드립니다.