예스스탁
예스스탁 답변
2022-11-15 10:44:26
안녕하세요
예스스탁입니다.
input : starttime(153000),endtime(630000),n(30);
var : Tcond(false),hh(0),h1(0),ll(0),l1(0);
if Bdate != Bdate[1] Then
SetStopEndofday(630000);
올리신 수식내용에 위 내용을 보시기 바랍니다.
지금 현재 시간이 잘못 지정되고 있습니다.
새벽 6시 30분은 63000 또는 063000으로 지정하셔야 합니다.
하지만 지정하신 630000은 63시00분00초로 잘못된 값입니다.
기존식에서 시간만 수정하시면 됩니다.
해당 내용에 대해 이미 79502번 글의 답변에 설명을 드렸습니다.
input : starttime(153000),endtime(63000),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);
}
}
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.236+PriceScale*n) Then
buy();
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 crossup(C,l1+(h1-l1)*-0.236+PriceScale*n) Then
buy();
if crossup(C,l1+(h1-l1)*-0.382+PriceScale*n) Then
buy();
if CrossDown(C,l1+(h1-l1)*1.236-PriceScale*n) Then
sell();
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 CrossDown(C,l1+(h1-l1)*-0.236-PriceScale*n) Then
sell();
if CrossDown(C,l1+(h1-l1)*-0.382-PriceScale*n) Then
sell();
}
if MarketPosition == 1 then
{
if crossup(c,h1+PriceScale*1) Then
exitlong();
if CrossDown(c,l1-PriceScale*1) Then
exitlong();
}
if MarketPosition == -1 then
{
if crossup(c,h1+PriceScale*1) Then
ExitShort();
if CrossDown(c,l1-PriceScale*1) Then
ExitShort();
}
즐거운 하루되세요
> 푸른 님이 쓴 글입니다.
> 제목 : 수식 문의 드립니다
>
input : starttime(153000),endtime(630000),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.236+PriceScale*n) Then
buy();
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 crossup(C,l1+(h1-l1)*-0.236+PriceScale*n) Then
buy();
if crossup(C,l1+(h1-l1)*-0.382+PriceScale*n) Then
buy();
if CrossDown(C,l1+(h1-l1)*1.236-PriceScale*n) Then
sell();
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 CrossDown(C,l1+(h1-l1)*-0.236-PriceScale*n) Then
sell();
if CrossDown(C,l1+(h1-l1)*-0.382-PriceScale*n) Then
sell();
}
if MarketPosition == 1 then
{
if crossup(c,h1+PriceScale*1) Then
exitlong();
if CrossDown(c,l1-PriceScale*1) Then
exitlong();
}
if MarketPosition == -1 then
{
if crossup(c,h1+PriceScale*1) Then
ExitShort();
if CrossDown(c,l1-PriceScale*1) Then
ExitShort();
}
--------------------------
위 수식어의 매매시간이 15:30~ 아침 06:30 까지인데 아침 06:30 에 오버없는
강제청산을 추가를 부탁드립니다.
한번 부탁드린적 있었는데 강제청산이 없어서 다시 올려봅니다.
아래는 청산이 안되었던 79482번의 답변입니다.
input : starttime(153000),endtime(630000),n(30);
var : Tcond(false),hh(0),h1(0),ll(0),l1(0);
if Bdate != Bdate[1] Then
SetStopEndofday(630000);
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.236+PriceScale*n) Then
buy();
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 crossup(C,l1+(h1-l1)*-0.236+PriceScale*n) Then
buy();
if crossup(C,l1+(h1-l1)*-0.382+PriceScale*n) Then
buy();
if CrossDown(C,l1+(h1-l1)*1.236-PriceScale*n) Then
sell();
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 CrossDown(C,l1+(h1-l1)*-0.236-PriceScale*n) Then
sell();
if CrossDown(C,l1+(h1-l1)*-0.382-PriceScale*n) Then
sell();
}
if MarketPosition == 1 then
{
if crossup(c,h1+PriceScale*1) Then
exitlong();
if CrossDown(c,l1-PriceScale*1) Then
exitlong();
}
if MarketPosition == -1 then
{
if crossup(c,h1+PriceScale*1) Then
ExitShort();
if CrossDown(c,l1-PriceScale*1) Then
ExitShort();
}
미리 감사드립니다.