커뮤니티
수식 부탁 드립니다.
2016-11-28 11:07:29
119
글번호 104400
안녕하세요
선물 분 틱봉 당일청산 피라미딩 아래 시스템에서 당일 매수 매도진입, 피라미딩 N(1),PN(2) 진입 청산이
10시05분 이전에 매수 매도청산(피라미딩 포함), 당일손실제한 손절 등으로 청산완료 포지션이 없는 경우,
10시10분 부터 12시10분까지 5이평이 10이평을 상향돌파시 매수, 하향돌파시 매도 1회 재진입 수식 추가
요청 드립니다.
1회 재진입 수식에 대한 손절은 -0.5PT, 익절은 +1.2PT로 적용해 주시기 바랍니다.
항상 감사합니다.
input : N(1),PN(2),당일손실(1.0);
var : cnt(0),BCount(0),SCount(0);
var : NP(0),PreNP(0),DayPL(0),lossK(0),v1(0);
var : Bxcond(false),SxCond(false);
var : Xcond(false),ProfitCond(false);
var : BE2(false),BE3(false),SE2(false),SE3(false);
var : B2(0),B3(0),S2(0),S3(0);
NP = NetProfit;
if date != date[1] Then{
preNP = NP[1];
Condition1 = false;
v1 = 0;
Xcond == false;
ProfitCond == false;
}
dayPL = NP-PreNP;
BCount = 0 ;
SCount = 0 ;
for cnt = 0 to 10 {
if EntryDate(cnt) == sdate and MarketPosition(cnt) == 1 then
BCount = BCount + 1;
if EntryDate(cnt) == sdate and MarketPosition(cnt) == -1 then
SCount = SCount + 1;
}
if Condition1 == false and TotalTrades > TotalTrades[1] Then{
Condition1 = true;
if PositionProfit(1) > 0 Then
v1 = PositionProfit(1);
}
//--------------------------------------------------------------------------------------------------------
#당일손실제한
if MarketPosition == 1 Then{
ExitLong("당일손실제한bx3",AtStop,avgEntryPrice-(당일손실+(dayPL-v1))/CurrentContracts);
}
if MarketPosition == -1 Then{
ExitShort("당일손실제한sx3",AtStop,avgEntryPrice+(당일손실+(dayPL-v1))/CurrentContracts);
}
//--------------------------------------------------------------------------------------------------------
#피라미딩진입수식
Input : i증감(0.2),누적진입횟수(3),진입수량(1);
if MarketPosition == 1 and MaxEntries < 누적진입횟수 and Bxcond == false Then
Buy("PBB",AtStop,LatestEntryPrice(0)+i증감,진입수량);
if MarketPosition == -1 and MaxEntries < 누적진입횟수 and SxCond == false Then
sell("PSS",AtStop,LatestEntryPrice(0)-i증감,진입수량);
//=======================================================================================================
# 10:05 이전 청산완료 포지션이 없는 경우 1회 재진입 수식 추가요청
//=======================================================================================================
#진입 청산식 예제
Input : Period(12), Period1(5);
Var : value(0);
value = StochasticsK(Period,Period1);
# 매수진입
If CrossUP(value, 20) and BCount+SCount < N and dayPL > -당일손실 Then{
Buy();
}
# 매도진입
If CrossDown(value, 80) and BCount+SCount < N and dayPL > -당일손실 Then{
Sell();
}
//--------------------------------------------------------------------------------------------------------
#매수청산
if MarketPosition == 1 and BCount+SCount < PN and dayPL > -당일손실 then{
ExitLong("bx",AtStop,EntryPrice+1.5);
#매도청산
if MarketPosition == -1 and BCount+SCount < PN and dayPL > -당일손실 then{
ExitShort("sx",AtStop,EntryPrice+1.5);
//=======================================================================================================
#당일 청산시간
SetStopEndofday(153000);
//=======================================================================================================
답변 1
예스스탁 예스스탁 답변
2016-11-28 13:55:01
안녕하세요
예스스탁입니다.
input : N(1),PN(2),당일손실(1.0);
var : cnt(0),BCount(0),SCount(0);
var : NP(0),PreNP(0),DayPL(0),lossK(0),v1(0);
var : Bxcond(false),SxCond(false);
var : Xcond(false),ProfitCond(false);
var : BE2(false),BE3(false),SE2(false),SE3(false);
var : B2(0),B3(0),S2(0),S3(0),Add(false),addcnt(0),mav(0);
NP = NetProfit;
mav = ma(c,5);
if date != date[1] Then{
Add = false;
Addcnt = 0;
preNP = NP[1];
Condition1 = false;
v1 = 0;
Xcond == false;
ProfitCond == false;
}
dayPL = NP-PreNP;
BCount = 0 ;
SCount = 0 ;
for cnt = 0 to 10 {
if EntryDate(cnt) == sdate and MarketPosition(cnt) == 1 then
BCount = BCount + 1;
if EntryDate(cnt) == sdate and MarketPosition(cnt) == -1 then
SCount = SCount + 1;
}
if Condition1 == false and TotalTrades > TotalTrades[1] Then{
Condition1 = true;
if PositionProfit(1) > 0 Then
v1 = PositionProfit(1);
}
//--------------------------------------------------------------------------------------------------------
#당일손실제한
if MarketPosition == 1 Then{
ExitLong("당일손실제한bx3",AtStop,avgEntryPrice-(당일손실+(dayPL-v1))/CurrentContracts);
}
if MarketPosition == -1 Then{
ExitShort("당일손실제한sx3",AtStop,avgEntryPrice+(당일손실+(dayPL-v1))/CurrentContracts);
}
//--------------------------------------------------------------------------------------------------------
#피라미딩진입수식
Input : i증감(0.2),누적진입횟수(3),진입수량(1);
if MarketPosition == 1 and MaxEntries < 누적진입횟수 and Bxcond == false Then
Buy("PBB",AtStop,LatestEntryPrice(0)+i증감,진입수량);
if MarketPosition == -1 and MaxEntries < 누적진입횟수 and SxCond == false Then
sell("PSS",AtStop,LatestEntryPrice(0)-i증감,진입수량);
//=======================================================================================================
# 10:05 이전 청산완료 포지션이 없는 경우 1회 재진입 수식 추가요청
if (stime == 100500 or (stime > 100500 and stime[1] < 100500)) and MarketPosition == 0 Then
Add = true;
if MarketPosition == 0 and add == true and stime >= 101000 and stime < 121000 Then{
if addcnt == 0 and crossup(C,mav) Then{
Addcnt = Addcnt+1;
buy("AddB");
}
if addcnt == 0 and CrossDown(c,mav) Then{
Addcnt = Addcnt+1;
sell("AddS");
}
}
if MarketPosition == 1 and IsEntryName("AddB") == true then{
ExitLong("bp",atlimit,EntryPrice+1.2);
ExitLong("bl",atlimit,EntryPrice-0.5);
}
if MarketPosition == 1 and IsEntryName("AddS") == true then{
ExitShort("sp",atlimit,EntryPrice-1.2);
ExitShort("sl",atlimit,EntryPrice+0.5);
}
//=======================================================================================================
#진입 청산식 예제
Input : Period(12), Period1(5);
Var : value(0);
value = StochasticsK(Period,Period1);
# 매수진입
If CrossUP(value, 20) and BCount+SCount < N and dayPL > -당일손실 Then{
Buy();
}
# 매도진입
If CrossDown(value, 80) and BCount+SCount < N and dayPL > -당일손실 Then{
Sell();
}
//--------------------------------------------------------------------------------------------------------
#매수청산
if MarketPosition == 1 and BCount+SCount < PN and dayPL > -당일손실 then
ExitLong("bx",AtStop,EntryPrice+1.5);
#매도청산
if MarketPosition == -1 and BCount+SCount < PN and dayPL > -당일손실 then
ExitShort("sx",AtStop,EntryPrice+1.5);
//=======================================================================================================
#당일 청산시간
SetStopEndofday(153000);
//=======================================================================================================
즐거운 하루되세요
> dandy 님이 쓴 글입니다.
> 제목 : 수식 부탁 드립니다.
> 안녕하세요
선물 분 틱봉 당일청산 피라미딩 아래 시스템에서 당일 매수 매도진입, 피라미딩 N(1),PN(2) 진입 청산이
10시05분 이전에 매수 매도청산(피라미딩 포함), 당일손실제한 손절 등으로 청산완료 포지션이 없는 경우,
10시10분 부터 12시10분까지 5이평이 10이평을 상향돌파시 매수, 하향돌파시 매도 1회 재진입 수식 추가
요청 드립니다.
1회 재진입 수식에 대한 손절은 -0.5PT, 익절은 +1.2PT로 적용해 주시기 바랍니다.
항상 감사합니다.
input : N(1),PN(2),당일손실(1.0);
var : cnt(0),BCount(0),SCount(0);
var : NP(0),PreNP(0),DayPL(0),lossK(0),v1(0);
var : Bxcond(false),SxCond(false);
var : Xcond(false),ProfitCond(false);
var : BE2(false),BE3(false),SE2(false),SE3(false);
var : B2(0),B3(0),S2(0),S3(0);
NP = NetProfit;
if date != date[1] Then{
preNP = NP[1];
Condition1 = false;
v1 = 0;
Xcond == false;
ProfitCond == false;
}
dayPL = NP-PreNP;
BCount = 0 ;
SCount = 0 ;
for cnt = 0 to 10 {
if EntryDate(cnt) == sdate and MarketPosition(cnt) == 1 then
BCount = BCount + 1;
if EntryDate(cnt) == sdate and MarketPosition(cnt) == -1 then
SCount = SCount + 1;
}
if Condition1 == false and TotalTrades > TotalTrades[1] Then{
Condition1 = true;
if PositionProfit(1) > 0 Then
v1 = PositionProfit(1);
}
//--------------------------------------------------------------------------------------------------------
#당일손실제한
if MarketPosition == 1 Then{
ExitLong("당일손실제한bx3",AtStop,avgEntryPrice-(당일손실+(dayPL-v1))/CurrentContracts);
}
if MarketPosition == -1 Then{
ExitShort("당일손실제한sx3",AtStop,avgEntryPrice+(당일손실+(dayPL-v1))/CurrentContracts);
}
//--------------------------------------------------------------------------------------------------------
#피라미딩진입수식
Input : i증감(0.2),누적진입횟수(3),진입수량(1);
if MarketPosition == 1 and MaxEntries < 누적진입횟수 and Bxcond == false Then
Buy("PBB",AtStop,LatestEntryPrice(0)+i증감,진입수량);
if MarketPosition == -1 and MaxEntries < 누적진입횟수 and SxCond == false Then
sell("PSS",AtStop,LatestEntryPrice(0)-i증감,진입수량);
//=======================================================================================================
# 10:05 이전 청산완료 포지션이 없는 경우 1회 재진입 수식 추가요청
//=======================================================================================================
#진입 청산식 예제
Input : Period(12), Period1(5);
Var : value(0);
value = StochasticsK(Period,Period1);
# 매수진입
If CrossUP(value, 20) and BCount+SCount < N and dayPL > -당일손실 Then{
Buy();
}
# 매도진입
If CrossDown(value, 80) and BCount+SCount < N and dayPL > -당일손실 Then{
Sell();
}
//--------------------------------------------------------------------------------------------------------
#매수청산
if MarketPosition == 1 and BCount+SCount < PN and dayPL > -당일손실 then{
ExitLong("bx",AtStop,EntryPrice+1.5);
#매도청산
if MarketPosition == -1 and BCount+SCount < PN and dayPL > -당일손실 then{
ExitShort("sx",AtStop,EntryPrice+1.5);
//=======================================================================================================
#당일 청산시간
SetStopEndofday(153000);
//=======================================================================================================
다음글
이전글