커뮤니티
수식 부탁드립니다
2019-05-24 18:52:12
141
글번호 128971
수고하십니다...
1. 한계약이라도 익절 되면 다음 진입때 1계약으로 진입 할수 있는 수식 부탁드립니다..
매수 3계약 진입후 2계약 청산,1계약은 손절 된다면 다음 매도 진입때 1계약으로
진입해야 하는데 4계약으로 진입됩니다..
2. overtick(10 ): 중심가 보다 10틱이상이면 중심가와 돌파봉의 종가의 1/2 에 매수 신호를
발생하는데 진입시 다음 봉이 음봉일때만 진입이 됩니다.
돌파봉 다음 봉이 양봉일때도 계속 신호가 유지 될수 있도록 수식을 부탁드립니다.
매수 수식입니다..아래..
Input : 진입시작(90000),진입종료(40000),강제청산시간(50000),plus(2),cros_N(2),overtick(10 ), 지정가(100);
Input : Fir_PF(12);
Input : FFir_PF(20),TTwo_PF(35);
Input : FFFir_PF(20),TTTwo_PF(35),TTThr_PF(55);
Input : FFFFir_PF(25),TTTTwo_PF(45),TTTThr_PF(60),FFFFor_PF(70);
var : Tcond(false),vol(0),cross(0), mid(0);
mid = (DayHigh+daylow)/2;
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] Then
SetStopEndofday(강제청산시간);
if bdate != bdate[1] Then
SetStopEndofday(0);
if Tcond == true then //1차조건
{
if MarketPosition <= 0 and crossup(C,mid + PriceScale*plus) Then
{
if MarketPosition == -1 Then
{
cross = cross+1;
if cross == cros_N Then
{
cross = 0;
vol = vol+1;
}
}
Else
{
cross = 0;
vol = 1;
}
if c <= mid + PriceScale * overtick then
buy("B",OnClose,def,min(4,vol));
Else
buy("By_M",AtLimit,(C+Mid)/2,min(4,vol));
}
if MarketPosition >= 0 and CrossDown(c,mid - PriceScale*plus) Then
{
if MarketPosition == 1 Then
{
cross = cross+1;
if cross == cros_N Then
{
cross = 0;
vol = vol+1;
}
}
Else
{
cross = 0;
vol = 1;
}
if c >= mid - PriceScale*overtick Then
Sell("S",OnClose,def,min(4,vol));
Else
Sell("SM",AtLimit,(C + Mid)/2,min(4,vol));
}
if MarketPosition == 1 then
{
if MaxContracts == 1 Then
ExitLong("bx1",atlimit,EntryPrice+PriceScale*Fir_PF);
if MaxContracts == 2 Then
{
ExitLong("bx21",atlimit,EntryPrice+PriceScale*FFir_PF,"",1,1);
ExitLong("bx22",atlimit,EntryPrice+PriceScale*TTwo_PF,"",1,1);
}
if MaxContracts == 3 Then
{
ExitLong("bx31",atlimit,EntryPrice+PriceScale*FFFir_PF,"",1,1);
ExitLong("bx32",atlimit,EntryPrice+PriceScale*TTTwo_PF,"",1,1);
ExitLong("bx33",atlimit,EntryPrice+PriceScale*TTThr_PF,"",1,1);
}
if MaxContracts == 4 Then
{
ExitLong("bx41",atlimit,EntryPrice+PriceScale*FFFFir_PF,"",1,1);
ExitLong("bx42",atlimit,EntryPrice+PriceScale*TTTTwo_PF,"",1,1);
ExitLong("bx43",atlimit,EntryPrice+PriceScale*TTTThr_PF,"",1,1);
ExitLong("bx44",atlimit,EntryPrice+PriceScale*FFFFor_PF,"",1,1);
}
}
답변 1
예스스탁 예스스탁 답변
2019-05-28 09:57:23
안녕하세요
예스스탁입니다.
2번은 수식에서 돌파봉이 중심가+10틱 위이면
종가와 중심가의 중간값까지 다음봉의 가격이 하락해야 신호가 발생하기 때문입니다.
수식에서는 음봉으로 지정한 부분이 없습니다.
해당 부분은 조건자체를 변경해야 하는 부분입니다. 별도로 변경해 드릴방법이 없습니다.
Input : 진입시작(90000),진입종료(40000),강제청산시간(50000),plus(2),cros_N(2),overtick(10 ), 지정가(100);
Input : Fir_PF(12);
Input : FFir_PF(20),TTwo_PF(35);
Input : FFFir_PF(20),TTTwo_PF(35),TTThr_PF(55);
Input : FFFFir_PF(25),TTTTwo_PF(45),TTTThr_PF(60),FFFFor_PF(70);
var : Tcond(false),vol(0),cross(0), mid(0);
mid = (DayHigh+daylow)/2;
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] Then
SetStopEndofday(강제청산시간);
if bdate != bdate[1] Then
SetStopEndofday(0);
if Tcond == true then //1차조건
{
if MarketPosition <= 0 and crossup(C,mid + PriceScale*plus) Then
{
if MarketPosition == -1 and CurrentContracts == MaxContracts Then
{
cross = cross+1;
if cross == cros_N Then
{
cross = 0;
vol = vol+1;
}
}
Else
{
cross = 0;
vol = 1;
}
if c <= mid + PriceScale * overtick then
buy("B",OnClose,def,min(4,vol));
Else
buy("By_M",AtLimit,(C+Mid)/2,min(4,vol));
}
if MarketPosition >= 0 and CrossDown(c,mid - PriceScale*plus) Then
{
if MarketPosition == 1 and CurrentContracts == MaxContracts Then
{
cross = cross+1;
if cross == cros_N Then
{
cross = 0;
vol = vol+1;
}
}
Else
{
cross = 0;
vol = 1;
}
if c >= mid - PriceScale*overtick Then
Sell("S",OnClose,def,min(4,vol));
Else
Sell("SM",AtLimit,(C + Mid)/2,min(4,vol));
}
if MarketPosition == 1 then
{
if MaxContracts == 1 Then
ExitLong("bx1",atlimit,EntryPrice+PriceScale*Fir_PF);
if MaxContracts == 2 Then
{
ExitLong("bx21",atlimit,EntryPrice+PriceScale*FFir_PF,"",1,1);
ExitLong("bx22",atlimit,EntryPrice+PriceScale*TTwo_PF,"",1,1);
}
if MaxContracts == 3 Then
{
ExitLong("bx31",atlimit,EntryPrice+PriceScale*FFFir_PF,"",1,1);
ExitLong("bx32",atlimit,EntryPrice+PriceScale*TTTwo_PF,"",1,1);
ExitLong("bx33",atlimit,EntryPrice+PriceScale*TTThr_PF,"",1,1);
}
if MaxContracts == 4 Then
{
ExitLong("bx41",atlimit,EntryPrice+PriceScale*FFFFir_PF,"",1,1);
ExitLong("bx42",atlimit,EntryPrice+PriceScale*TTTTwo_PF,"",1,1);
ExitLong("bx43",atlimit,EntryPrice+PriceScale*TTTThr_PF,"",1,1);
ExitLong("bx44",atlimit,EntryPrice+PriceScale*FFFFor_PF,"",1,1);
}
}
}
즐거운 하루되세요
> 레드골드 님이 쓴 글입니다.
> 제목 : 수식 부탁드립니다
> 수고하십니다...
1. 한계약이라도 익절 되면 다음 진입때 1계약으로 진입 할수 있는 수식 부탁드립니다..
매수 3계약 진입후 2계약 청산,1계약은 손절 된다면 다음 매도 진입때 1계약으로
진입해야 하는데 4계약으로 진입됩니다..
2. overtick(10 ): 중심가 보다 10틱이상이면 중심가와 돌파봉의 종가의 1/2 에 매수 신호를
발생하는데 진입시 다음 봉이 음봉일때만 진입이 됩니다.
돌파봉 다음 봉이 양봉일때도 계속 신호가 유지 될수 있도록 수식을 부탁드립니다.
매수 수식입니다..아래..
Input : 진입시작(90000),진입종료(40000),강제청산시간(50000),plus(2),cros_N(2),overtick(10 ), 지정가(100);
Input : Fir_PF(12);
Input : FFir_PF(20),TTwo_PF(35);
Input : FFFir_PF(20),TTTwo_PF(35),TTThr_PF(55);
Input : FFFFir_PF(25),TTTTwo_PF(45),TTTThr_PF(60),FFFFor_PF(70);
var : Tcond(false),vol(0),cross(0), mid(0);
mid = (DayHigh+daylow)/2;
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] Then
SetStopEndofday(강제청산시간);
if bdate != bdate[1] Then
SetStopEndofday(0);
if Tcond == true then //1차조건
{
if MarketPosition <= 0 and crossup(C,mid + PriceScale*plus) Then
{
if MarketPosition == -1 Then
{
cross = cross+1;
if cross == cros_N Then
{
cross = 0;
vol = vol+1;
}
}
Else
{
cross = 0;
vol = 1;
}
if c <= mid + PriceScale * overtick then
buy("B",OnClose,def,min(4,vol));
Else
buy("By_M",AtLimit,(C+Mid)/2,min(4,vol));
}
if MarketPosition >= 0 and CrossDown(c,mid - PriceScale*plus) Then
{
if MarketPosition == 1 Then
{
cross = cross+1;
if cross == cros_N Then
{
cross = 0;
vol = vol+1;
}
}
Else
{
cross = 0;
vol = 1;
}
if c >= mid - PriceScale*overtick Then
Sell("S",OnClose,def,min(4,vol));
Else
Sell("SM",AtLimit,(C + Mid)/2,min(4,vol));
}
if MarketPosition == 1 then
{
if MaxContracts == 1 Then
ExitLong("bx1",atlimit,EntryPrice+PriceScale*Fir_PF);
if MaxContracts == 2 Then
{
ExitLong("bx21",atlimit,EntryPrice+PriceScale*FFir_PF,"",1,1);
ExitLong("bx22",atlimit,EntryPrice+PriceScale*TTwo_PF,"",1,1);
}
if MaxContracts == 3 Then
{
ExitLong("bx31",atlimit,EntryPrice+PriceScale*FFFir_PF,"",1,1);
ExitLong("bx32",atlimit,EntryPrice+PriceScale*TTTwo_PF,"",1,1);
ExitLong("bx33",atlimit,EntryPrice+PriceScale*TTThr_PF,"",1,1);
}
if MaxContracts == 4 Then
{
ExitLong("bx41",atlimit,EntryPrice+PriceScale*FFFFir_PF,"",1,1);
ExitLong("bx42",atlimit,EntryPrice+PriceScale*TTTTwo_PF,"",1,1);
ExitLong("bx43",atlimit,EntryPrice+PriceScale*TTTThr_PF,"",1,1);
ExitLong("bx44",atlimit,EntryPrice+PriceScale*FFFFor_PF,"",1,1);
}
}