커뮤니티
수식 1 요청 드립니다.
2015-09-26 23:58:29
131
글번호 90751
수식수정 요청 드립니다.
아래 데이용 시스템의 "당일진입횟수" "당일손실제한" 당일청산용 수식을
기존 오버형 시스템의 "당일진입횟수" "당일손실제한" 적용되는 수식으로 변경 요청 드립니다.
1.전일종가 기준 수식요청
//전일종가 기준 수익일경우 -> 처음 수익을 제외한 당일손실제한 강제청산 => 수익은 제외
//전일종가 기준 손실일경우 -> 처음 손실을 포함한 당일손실제한 강제청산 => 손실은 합산
2.당일시가 기준 수식요청
//당일시가 기준 수익일경우 -> 처음 수익을 제외한 당일손실제한 강제청산 => 수익은 제외
//당일시가 기준 손실일경우 -> 처음 손실을 포함한 당일손실제한 강제청산 => 손실은 합산
감사합니다.
#당일진입횟수 당일손실제한
input :N(2),당일손실(-1.5);
var : cnt(0),BCount(0),SCount(0);
var : NP(0),PreNP(0),DayPL(0),loss(0),v1(0);
NP = NetProfit;
if date != date[1] Then{
preNP = NP[1];
Condition1 = false;
v1 = 0;
}
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,EntryPrice+당일손실-(dayPL-v1));
}
if MarketPosition == -1 Then{
ExitShort("당일손실제한sx3",AtStop,EntryPrice-당일손실+(dayPL-v1));
}
//--------------------------------------------------------------------------------------
#손실손절1
if MarketPosition == -1 and crossup(H,EntryPrice+0.3) and BCount+SCount < N and dayPL > 당일손실 Then
buy("1BX");
if MarketPosition == 1 and CrossDown(L,EntryPrice-0.3) and BCount+SCount < N and dayPL > 당일손실 Then
sell("1SX");
//--------------------------------------------------------------------------------------
답변 1
예스스탁 예스스탁 답변
2015-09-30 13:39:48
안녕하세요
예스스탁입니다.
당일 시가기준으로 값을 저장할수는 없습니다.
1번은 전일종가기준, 2번은 첫봉 완성시 기준입니다.
1.
input :N(2),당일손실(-1.5);
var : cnt(0),BCount(0),SCount(0),Bcnt(0),Scnt(0);
var : NP(0),PreNP(0),DayPL(0),loss(0),v1(0);
NP = NetProfit;
if date != date[1] Then{
preNP = NP[1];
Condition1 = false;
v1 = 0;
Bcnt = 0;
Scnt = 0;
if MarketPosition == 1 and EntryDate < sdate then{
Bcnt = 1;
Condition1 = true;
if PositionProfit[1] > 0 Then{
V1 = PositionProfit[1];
}
}
if MarketPosition == -1 and EntryDate < sdate Then{
Scnt = 1;
Condition1 = true;
if PositionProfit[1] > 0 then{
V1 = PositionProfit[1];
}
}
}
dayPL = NP-PreNP;
BCount = 0 ;
SCount = 0 ;
for cnt = 0 to 10 {
if EntryDate(cnt) == sdate and MarketPosition(cnt) == 1 then
BCount = (BCount + 1)+Bcnt;
if EntryDate(cnt) == sdate and MarketPosition(cnt) == -1 then
SCount = (SCount + 1)+Scnt;
}
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,EntryPrice+당일손실-(dayPL-v1));
}
if MarketPosition == -1 Then{
ExitShort("당일손실제한sx3",AtStop,EntryPrice-당일손실+(dayPL-v1));
}
//--------------------------------------------------------------------------------------
#손실손절1
if MarketPosition == -1 and crossup(H,EntryPrice+0.3) and BCount+SCount < N and dayPL > 당일손실 Then
buy("1BX");
if MarketPosition == 1 and CrossDown(L,EntryPrice-0.3) and BCount+SCount < N and dayPL > 당일손실 Then
sell("1SX");
//--------------------------------------------------------------------------------------
2.
input :N(2),당일손실(-1.5);
var : cnt(0),BCount(0),SCount(0),Bcnt(0),Scnt(0);
var : NP(0),PreNP(0),DayPL(0),loss(0),v1(0);
NP = NetProfit;
if date != date[1] Then{
preNP = NP[1];
Condition1 = false;
v1 = 0;
Bcnt = 0;
Scnt = 0;
if MarketPosition == 1 and EntryDate < sdate then{
Bcnt = 1;
Condition1 = true;
if PositionProfit > 0 Then{
V1 = PositionProfit;
}
}
if MarketPosition == -1 and EntryDate < sdate Then{
Scnt = 1;
Condition1 = true;
if PositionProfit > 0 then{
V1 = PositionProfit;
}
}
}
dayPL = NP-PreNP;
BCount = 0 ;
SCount = 0 ;
for cnt = 0 to 10 {
if EntryDate(cnt) == sdate and MarketPosition(cnt) == 1 then
BCount = (BCount + 1)+Bcnt;
if EntryDate(cnt) == sdate and MarketPosition(cnt) == -1 then
SCount = (SCount + 1)+Scnt;
}
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,EntryPrice+당일손실-(dayPL-v1));
}
if MarketPosition == -1 Then{
ExitShort("당일손실제한sx3",AtStop,EntryPrice-당일손실+(dayPL-v1));
}
//--------------------------------------------------------------------------------------
#손실손절1
if MarketPosition == -1 and crossup(H,EntryPrice+0.3) and BCount+SCount < N and dayPL > 당일손실 Then
buy("1BX");
if MarketPosition == 1 and CrossDown(L,EntryPrice-0.3) and BCount+SCount < N and dayPL > 당일손실 Then
sell("1SX");
//--------------------------------------------------------------------------------------
즐거운 하루되세요
> dandy 님이 쓴 글입니다.
> 제목 : 수식 1 요청 드립니다.
> 수식수정 요청 드립니다.
아래 데이용 시스템의 "당일진입횟수" "당일손실제한" 당일청산용 수식을
기존 오버형 시스템의 "당일진입횟수" "당일손실제한" 적용되는 수식으로 변경 요청 드립니다.
1.전일종가 기준 수식요청
//전일종가 기준 수익일경우 -> 처음 수익을 제외한 당일손실제한 강제청산 => 수익은 제외
//전일종가 기준 손실일경우 -> 처음 손실을 포함한 당일손실제한 강제청산 => 손실은 합산
2.당일시가 기준 수식요청
//당일시가 기준 수익일경우 -> 처음 수익을 제외한 당일손실제한 강제청산 => 수익은 제외
//당일시가 기준 손실일경우 -> 처음 손실을 포함한 당일손실제한 강제청산 => 손실은 합산
감사합니다.
#당일진입횟수 당일손실제한
input :N(2),당일손실(-1.5);
var : cnt(0),BCount(0),SCount(0);
var : NP(0),PreNP(0),DayPL(0),loss(0),v1(0);
NP = NetProfit;
if date != date[1] Then{
preNP = NP[1];
Condition1 = false;
v1 = 0;
}
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,EntryPrice+당일손실-(dayPL-v1));
}
if MarketPosition == -1 Then{
ExitShort("당일손실제한sx3",AtStop,EntryPrice-당일손실+(dayPL-v1));
}
//--------------------------------------------------------------------------------------
#손실손절1
if MarketPosition == -1 and crossup(H,EntryPrice+0.3) and BCount+SCount < N and dayPL > 당일손실 Then
buy("1BX");
if MarketPosition == 1 and CrossDown(L,EntryPrice-0.3) and BCount+SCount < N and dayPL > 당일손실 Then
sell("1SX");
//--------------------------------------------------------------------------------------
다음글
이전글