커뮤니티
문의드립니다.
2014-02-20 01:07:15
133
글번호 72734
이 로직대로라면 시초가 첫 캔들 종가에 바로 진입하게되는데,
첫 신호가 매수라면 매도부터 진입하게, 첫 신호가 매도라면 매수부터 진입하게
(즉, 첫번째 신호를 거르고 두번째 신호부터 진입하도록)
수식 수정 부탁드립니다.
var : T1(0),T2(0),T3(0),T4(0),T5(0);
var : X(0),W(0),cnt(0),count(0),NP(0),PreNP(0),dayPL(0);
input : dayentry(4),당일손실(-1.4),loss(100),Profit(100);
count = 0;
for cnt = 0 to 20{
if sdate == EntryDate(cnt) Then
count = count+1;
}
NP = NetProfit;
if date != date[1] Then{
Condition1 = False;
PreNP = NP[1];
}
dayPL = (NP-PreNP)+PositionProfit;
X = min(T1,T2,T3,T4);
W = iff(T5[1]<T5,X,T5);
if count < dayentry and dayPL > 당일손실 Then{
if T1 > W Then{
if count == 0 or
(count >= 1 and MarketPosition == -1) Or
(Count >= 1 and MarketPosition == 0 and MarketPosition(1) != 1) Then{
buy();
}
}
if T1 <= W then {
if count == 0 or
(count >= 1 and MarketPosition == 1) Or
(Count >= 1 and MarketPosition == 0 and MarketPosition(1) != -1) Then{
sell();
}
}
}
SetStopProfittarget(Profit,PointStop);
SetStopLoss(loss,PointStop);
SetStopEndofday(150000);
if MarketPosition == 1 and T1 <= W Then
ExitLong("daybx2",Atstop,EntryPrice+(당일손실-DayPL));
if MarketPosition == -1 and T1 > W Then
ExitShort("daysx2",Atstop,EntryPrice-(당일손실-DayPL));
if MarketPosition == 1 and T1 <= W Then
ExitLong();
if MarketPosition == -1 and T1 > W Then
ExitShort();
감사합니다.
답변 1
예스스탁 예스스탁 답변
2014-02-20 16:48:42
안녕하세요
예스스탁입니다.
var : T1(0),T2(0),T3(0),T4(0),T5(0);
var : X(0),W(0),cnt(0),count(0),NP(0),PreNP(0),dayPL(0);
input : dayentry(4),당일손실(-1.4),loss(100),Profit(100);
count = 0;
for cnt = 0 to 20{
if sdate == EntryDate(cnt) Then
count = count+1;
}
NP = NetProfit;
if date != date[1] Then{
Condition1 = False;
PreNP = NP[1];
}
dayPL = (NP-PreNP)+PositionProfit;
X = min(T1,T2,T3,T4);
W = iff(T5[1]<T5,X,T5);
if Condition1 == false and T1 > W and T1[1] <= W[1] and dayindex > 0 Then
Condition1 = true;
if Condition1 == false and T1 <= W and T1[1] > W[1] and dayindex > 0 Then
Condition1 = true;
if count < dayentry and dayPL > 당일손실 Then{
if T1 > W and dayindex > 0 and Condition1 == true Then{
if count == 0 or
(count >= 1 and MarketPosition == -1) Or
(Count >= 1 and MarketPosition == 0 and MarketPosition(1) != 1) Then{
buy();
}
}
if T1 <= W and dayindex > 0 and Condition1 == true then {
if count == 0 or
(count >= 1 and MarketPosition == 1) Or
(Count >= 1 and MarketPosition == 0 and MarketPosition(1) != -1) Then{
sell();
}
}
}
SetStopProfittarget(Profit,PointStop);
SetStopLoss(loss,PointStop);
SetStopEndofday(150000);
if MarketPosition == 1 and T1 <= W Then
ExitLong("daybx2",Atstop,EntryPrice+(당일손실-DayPL));
if MarketPosition == -1 and T1 > W Then
ExitShort("daysx2",Atstop,EntryPrice-(당일손실-DayPL));
if MarketPosition == 1 and T1 <= W Then
ExitLong();
if MarketPosition == -1 and T1 > W Then
ExitShort();
즐거운 하루되세요
> 마코 님이 쓴 글입니다.
> 제목 : 문의드립니다.
> 이 로직대로라면 시초가 첫 캔들 종가에 바로 진입하게되는데,
첫 신호가 매수라면 매도부터 진입하게, 첫 신호가 매도라면 매수부터 진입하게
(즉, 첫번째 신호를 거르고 두번째 신호부터 진입하도록)
수식 수정 부탁드립니다.
var : T1(0),T2(0),T3(0),T4(0),T5(0);
var : X(0),W(0),cnt(0),count(0),NP(0),PreNP(0),dayPL(0);
input : dayentry(4),당일손실(-1.4),loss(100),Profit(100);
count = 0;
for cnt = 0 to 20{
if sdate == EntryDate(cnt) Then
count = count+1;
}
NP = NetProfit;
if date != date[1] Then{
Condition1 = False;
PreNP = NP[1];
}
dayPL = (NP-PreNP)+PositionProfit;
X = min(T1,T2,T3,T4);
W = iff(T5[1]<T5,X,T5);
if count < dayentry and dayPL > 당일손실 Then{
if T1 > W Then{
if count == 0 or
(count >= 1 and MarketPosition == -1) Or
(Count >= 1 and MarketPosition == 0 and MarketPosition(1) != 1) Then{
buy();
}
}
if T1 <= W then {
if count == 0 or
(count >= 1 and MarketPosition == 1) Or
(Count >= 1 and MarketPosition == 0 and MarketPosition(1) != -1) Then{
sell();
}
}
}
SetStopProfittarget(Profit,PointStop);
SetStopLoss(loss,PointStop);
SetStopEndofday(150000);
if MarketPosition == 1 and T1 <= W Then
ExitLong("daybx2",Atstop,EntryPrice+(당일손실-DayPL));
if MarketPosition == -1 and T1 > W Then
ExitShort("daysx2",Atstop,EntryPrice-(당일손실-DayPL));
if MarketPosition == 1 and T1 <= W Then
ExitLong();
if MarketPosition == -1 and T1 > W Then
ExitShort();
감사합니다.
다음글
이전글