커뮤니티
62394 수식 수정부탁드립니다..
2019-05-08 01:33:28
153
글번호 128489
1. 매수 매도를 진입을 당일 중심가로 변경하고..
2. 거래시간을 09 : 00시부터 익일 04시 50분으로 하고싶습니다.
3. 수식에서 익절 후, 재 진입시 1계약으로 다시 시작 되어서면 합니다.
(아래 수식은 진입시 마다 계약수가 늘어남)
--- 62394 수식입니다.----
var : vol(0),cross(0);
if bdate != bdate[1] Then
{
vol = 1;
cross = 0;
}
if MarketPosition <= 0 and bDate == bDate[1] and
C > O and crossup(c[1],dayopen(0)[1]) Then
{
if MarketPosition == -1 Then
{
cross = cross+1;
if cross == 2 Then
{
cross = 0;
vol = vol*2;
}
}
buy("b",OnClose,def,vol);
}
if MarketPosition >= 0 and bDate == bDate[1] and
C < O and CrossDown(c[1],dayopen(0)[1]) Then
{
if MarketPosition == 1 Then
{
cross = cross+1;
if cross == 2 Then
{
cross = 0;
vol = vol*2;
}
}
sell("s",OnClose,def,vol);
}
SetStopProfittarget(PriceScale*100,PointStop);
답변 1
예스스탁 예스스탁 답변
2019-05-08 14:45:51
안녕하세요
예스스탁입니다.
var : vol(0),cross(0);
input : endtime(045000);
var : Tcond(false);
if bdate != bdate[1] Then
{
Tcond = true;
vol = 1;
cross = 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 MarketPosition <= 0 and bDate == bDate[1] and tcond == true and
C > O and crossup(c[1],dayopen(0)[1]) Then
{
if MarketPosition == -1 Then
{
cross = cross+1;
if cross == 2 Then
{
cross = 0;
vol = vol*2;
}
}
Else
{
cross = 0;
vol = 1;
}
buy("b",OnClose,def,vol);
}
if MarketPosition >= 0 and bDate == bDate[1] and tcond == true and
C < O and CrossDown(c[1],dayopen(0)[1]) Then
{
if MarketPosition == 1 Then
{
cross = cross+1;
if cross == 2 Then
{
cross = 0;
vol = vol*2;
}
}
Else
{
cross = 0;
vol = 1;
}
sell("s",OnClose,def,vol);
}
SetStopProfittarget(PriceScale*100,PointStop);
즐거운 하루되세요
> 레드골드 님이 쓴 글입니다.
> 제목 : 62394 수식 수정부탁드립니다..
> 1. 매수 매도를 진입을 당일 중심가로 변경하고..
2. 거래시간을 09 : 00시부터 익일 04시 50분으로 하고싶습니다.
3. 수식에서 익절 후, 재 진입시 1계약으로 다시 시작 되어서면 합니다.
(아래 수식은 진입시 마다 계약수가 늘어남)
--- 62394 수식입니다.----
var : vol(0),cross(0);
if bdate != bdate[1] Then
{
vol = 1;
cross = 0;
}
if MarketPosition <= 0 and bDate == bDate[1] and
C > O and crossup(c[1],dayopen(0)[1]) Then
{
if MarketPosition == -1 Then
{
cross = cross+1;
if cross == 2 Then
{
cross = 0;
vol = vol*2;
}
}
buy("b",OnClose,def,vol);
}
if MarketPosition >= 0 and bDate == bDate[1] and
C < O and CrossDown(c[1],dayopen(0)[1]) Then
{
if MarketPosition == 1 Then
{
cross = cross+1;
if cross == 2 Then
{
cross = 0;
vol = vol*2;
}
}
sell("s",OnClose,def,vol);
}
SetStopProfittarget(PriceScale*100,PointStop);
다음글
이전글