커뮤니티
해외 선물 시간 및 수식 부탁드립니다
2019-05-10 10:37:50
188
글번호 128558
1. 시가 돌파 시 매수, 매도 진입하고
2. 09시 부터 진입가능, 04 ~05시에는 진입불가(청산만가능), 05시에 강제청산
3. 2번 손절시 마다 1계약씩 늘려서 진입....총 4계약까지만 진입
4. 익절은 4계약일때 각각 10틱, 20틱, 30틱, 40틱 익절
. 3계약일때 각각 10틱, 20틱, 40틱 익절
2계약일때 각각 10틱, 30틱 익절
1계약일때 20틱 익절 수식을 부탁드립니다..
수고하십시요...항상 감사합니다..^^
답변 1
예스스탁 예스스탁 답변
2019-05-10 11:51:36
안녕하세요
예스스탁입니다.
var : vol(0),cross(0);
input : 진입시작(90000),진입종료(040000),강제청산시간(050000);
var : Tcond(false);
if (sdate != sdate[1] and stime >= 진입시작) or
(sdate == sdate[1] and stime >= 진입시작 and stime[1] < 진입시작) then
{
Tcond = true;
vol = 1;
cross = 0;
}
if (sdate != sdate[1] and stime >= 진입종료) or
(sdate == sdate[1] and stime >= 진입종료 and stime[1] < 진입종료) then
{
Tcond = false;
}
if (sdate != sdate[1] and stime >= 강제청산시간) or
(sdate == sdate[1] and stime >= 강제청산시간 and stime[1] < 강제청산시간) then
{
if MarketPosition == 1 Then
ExitLong("bx");
if MarketPosition == -1 Then
ExitShort("sx");
}
if Tcond == true then
{
if MarketPosition <= 0 and tcond == true and crossup(C,dayopen) 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,min(4,vol));
}
if MarketPosition >= 0 and tcond == true and CrossDown(c,dayopen) 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,min(4,vol));
}
if MarketPosition == 1 then
{
if MaxEntries == 1 Then
ExitLong("bx1",atlimit,EntryPrice+PriceScale*20);
if MaxEntries == 2 Then
{
ExitLong("bx21",atlimit,EntryPrice+PriceScale*10,"",1,1);
ExitLong("bx22",atlimit,EntryPrice+PriceScale*30,"",1,1);
}
if MaxEntries == 3 Then
{
ExitLong("bx31",atlimit,EntryPrice+PriceScale*10,"",1,1);
ExitLong("bx32",atlimit,EntryPrice+PriceScale*20,"",1,1);
ExitLong("bx33",atlimit,EntryPrice+PriceScale*30,"",1,1);
}
if MaxEntries == 4 Then
{
ExitLong("bx41",atlimit,EntryPrice+PriceScale*10,"",1,1);
ExitLong("bx42",atlimit,EntryPrice+PriceScale*20,"",1,1);
ExitLong("bx43",atlimit,EntryPrice+PriceScale*30,"",1,1);
ExitLong("bx44",atlimit,EntryPrice+PriceScale*40,"",1,1);
}
}
if MarketPosition == -1 then
{
if MaxEntries == 1 Then
ExitShort("sx1",atlimit,EntryPrice-PriceScale*20);
if MaxEntries == 2 Then
{
ExitShort("sx21",atlimit,EntryPrice-PriceScale*10,"",1,1);
ExitShort("sx22",atlimit,EntryPrice-PriceScale*30,"",1,1);
}
if MaxEntries == 3 Then
{
ExitShort("sx31",atlimit,EntryPrice-PriceScale*10,"",1,1);
ExitShort("sx32",atlimit,EntryPrice-PriceScale*20,"",1,1);
ExitShort("sx33",atlimit,EntryPrice-PriceScale*30,"",1,1);
}
if MaxEntries == 4 Then
{
ExitShort("sx41",atlimit,EntryPrice-PriceScale*10,"",1,1);
ExitShort("sx42",atlimit,EntryPrice-PriceScale*20,"",1,1);
ExitShort("sx43",atlimit,EntryPrice-PriceScale*30,"",1,1);
ExitShort("sx44",atlimit,EntryPrice-PriceScale*40,"",1,1);
}
}
}
즐거운 하루되세요
> 레드골드 님이 쓴 글입니다.
> 제목 : 해외 선물 시간 및 수식 부탁드립니다
> 1. 시가 돌파 시 매수, 매도 진입하고
2. 09시 부터 진입가능, 04 ~05시에는 진입불가(청산만가능), 05시에 강제청산
3. 2번 손절시 마다 1계약씩 늘려서 진입....총 4계약까지만 진입
4. 익절은 4계약일때 각각 10틱, 20틱, 30틱, 40틱 익절
. 3계약일때 각각 10틱, 20틱, 40틱 익절
2계약일때 각각 10틱, 30틱 익절
1계약일때 20틱 익절 수식을 부탁드립니다..
수고하십시요...항상 감사합니다..^^