커뮤니티
문의
2014-10-21 07:57:51
169
글번호 79595
앞전 매매 손실이 2회발생 시 손실로 마감된 가격을 저장하고.. 다음 신호의 가격이 손실로 마감된 가격의 +3틱 -3틱 이내의 가격에서는 진입되지 않도록 수식수정 부탁드립니다.
(저는 매수, 매도, 매수, 매도.. 항상 포지션을 유지하고 있습니다.)
if OpenPositionProfit<=0 Then //현재 진행 중인 거래가 손실이면
var8=c; //손실 마감 가격 저장
//기존 거래 손실이 2회 이면...
if PositionProfit(1) <= 0 and PositionProfit(2) <= 0 Then
Condition3 = True;
Else
Condition3 = False;
if Condition3==True and MarketPosition==1 Then
if abs(var8) >= abs(var8[1])+PriceScale*3 then
Sell("S");
if Condition3==True and MarketPosition==-1 Then
if abs(var8) >= abs(var8[1])+PriceScale*3 Then
Buy("B");
답변 1
예스스탁 예스스탁 답변
2014-10-21 14:31:23
안녕하세요
예스스탁입니다.
if PositionProfit(1) <= 0 and PositionProfit(2) <= 0 and EntryDate(2) > 0 Then
Condition3 = True;
Else
Condition3 = False;
if 매수조건 Then{
if MarketPosition == 0 and Condition1 == false then
buy();
if MarketPosition == 0 and Condition1 == true and (c >= ExitPrice(1)+PriceScale*3 or C <= ExitPrice(1)-PriceScale*3) then
buy();
if MarketPosition == -1 and !(C >= EntryPrice and PositionProfit(1) <= 0 and EntryDate(1) > 0) then
Sell();
if MarketPosition == -1 and C >= EntryPrice and PositionProfit(1) <= 0 and EntryDate(1) > 0 then
ExitShort();
}
if 매도조건 Then{
if MarketPosition >= 0 and Condition1 == false then
Sell();
if MarketPosition == 0 and Condition1 == true and (c >= ExitPrice(1)+PriceScale*3 or C <= ExitPrice(1)-PriceScale*3) then
sell();
if MarketPosition == 1 and !(C <= EntryPrice and PositionProfit(1) <= 0 and EntryDate(1) > 0) then
Sell();
if MarketPosition == 1 and C <= EntryPrice and PositionProfit(1) <= 0 and EntryDate(1) > 0 then
ExitLong();
}
즐거운 하루되세요
> hjkang철인 님이 쓴 글입니다.
> 제목 : 문의
> 앞전 매매 손실이 2회발생 시 손실로 마감된 가격을 저장하고.. 다음 신호의 가격이 손실로 마감된 가격의 +3틱 -3틱 이내의 가격에서는 진입되지 않도록 수식수정 부탁드립니다.
(저는 매수, 매도, 매수, 매도.. 항상 포지션을 유지하고 있습니다.)
if OpenPositionProfit<=0 Then //현재 진행 중인 거래가 손실이면
var8=c; //손실 마감 가격 저장
//기존 거래 손실이 2회 이면...
if PositionProfit(1) <= 0 and PositionProfit(2) <= 0 Then
Condition3 = True;
Else
Condition3 = False;
if Condition3==True and MarketPosition==1 Then
if abs(var8) >= abs(var8[1])+PriceScale*3 then
Sell("S");
if Condition3==True and MarketPosition==-1 Then
if abs(var8) >= abs(var8[1])+PriceScale*3 Then
Buy("B");
다음글
이전글