커뮤니티
수식문의
2017-03-07 10:56:42
126
글번호 107535
안녕하세요.
당일매매 첫번째 매매 이익이 1P 이상이면 당일 매매 종료
당일매매 첫번째 매매 이익이 1P 이하이면
당일 매매는 두번만 진입하고 매매종료 하는식
당일매매 첫번째 매매가 손실이면 두번째 진입후
첫번째 손실의 50% 이익이나면 청산
그리고 세번째 진입후 첫번째 손실의 50% 이익이나면 청산
두번째 세번째 진입이 손실이 나도
당일 매매는 세번만 진입하고 매매종료 하는식
수고하십시요
답변 3
예스스탁 예스스탁 답변
2017-03-07 16:01:57
안녕하세요
예스스탁입니다
아래 식구조 참고하시기 바랍니다.
1
var : T1(0),entry(0);
if Bdate != Bdate[1] Then
T1= TotalTrades;
if MarketPosition == 0 Then
entry = TotalTrades-T1;
Else
entry = (TotalTrades-T1)+1;
if 매수진입조건 and entry < 2 Then{
if entry == 0 or
(entry >= 1 and MarketPosition == -1 and C > EntryPrice-1) or
(entry >= 1 and MarketPosition == 0 and PositionProfit(1) < 1) Then
buy();
}
if 매도진입조건 and entry < 2 Then{
if entry == 0 or
(entry >= 1 and MarketPosition == 1 and C < EntryPrice+1) or
(entry >= 1 and MarketPosition == 0 and PositionProfit(1) < 1) Then
sell();
}
2
var : T1(0),entry(0),PL1(0);
if Bdate != Bdate[1] Then{
T1= TotalTrades;
PL1 = 0;
}
if MarketPosition == 0 Then
entry = TotalTrades-T1;
Else
entry = (TotalTrades-T1)+1;
if PL1 == 0 and TotalTrades > TotalTrades[1] Then
PL1 = PositionProfit(1);
if 매수진입조건 Then{
if entry == 0 or
(entry == 1 and MarketPosition == -1 and C > EntryPrice) or
(entry == 1 and MarketPosition == 0 and PositionProfit(1) < 0) or
entry == 2 Then
buy();
if entry == 3 and MarketPosition == -1 Then
ExitShort();
}
if 매도진입조건 Then{
if entry == 0 or
(entry == 1 and MarketPosition == 1 and C < EntryPrice) or
(entry == 1 and MarketPosition == 0 and PositionProfit(1) < 0) or
entry == 2 Then
sell();
if entry == 3 and MarketPosition == 1 Then
ExitLong();
}
if MarketPosition == 1 then{
if entry >= 2 then
exitlong("bx",Atlimit,EntryPrice+abs(PL1*0.5));
}
if MarketPosition == -1 then{
if entry >= 2 then
ExitShort("sx",Atlimit,EntryPrice-abs(PL1*0.5));
}
즐거운 하루되세요
> 초보자 님이 쓴 글입니다.
> 제목 : 수식문의
> 안녕하세요.
당일매매 첫번째 매매 이익이 1P 이상이면 당일 매매 종료
당일매매 첫번째 매매 이익이 1P 이하이면
당일 매매는 두번만 진입하고 매매종료 하는식
당일매매 첫번째 매매가 손실이면 두번째 진입후
첫번째 손실의 50% 이익이나면 청산
그리고 세번째 진입후 첫번째 손실의 50% 이익이나면 청산
두번째 세번째 진입이 손실이 나도
당일 매매는 세번만 진입하고 매매종료 하는식
수고하십시요
초보자
2017-03-07 16:19:33
당일매매 첫번째 매매 이익이 1P 이하이면
당일 매매는 두번만 진입하고 매매종료 하는식하고
만약 매매 첫번째 매매가 손실이면 두번째 진입후
첫번째 손실의 50% 이익이나면 청산
그리고 세번째 진입후 첫번째 손실의 50% 이익이나면 청산
두번째 세번째 진입이 손실이 나도
당일 매매는 세번만 진입하고 매매종료 하는식
두개의 식이 아니라 하나의 식으로 부탁드리고
매수청산 매도 청산식도 포함해 주시기 바랍니다.
수고하십시요.
예스스탁 예스스탁 답변
2017-03-07 16:35:20
안녕하세요
예스스탁입니다
사용하는 다른청산이 있으면 하단으로 추가하시면 됩니다.
var : T1(0),entry(0),PL1(0);
if Bdate != Bdate[1] Then{
T1 = TotalTrades;
PL1 = 0;
}
if MarketPosition == 0 Then
entry = TotalTrades-T1;
Else
entry = (TotalTrades-T1)+1;
if PL1 == 0 and TotalTrades > TotalTrades[1] Then
PL1 = PositionProfit(1);
if 매수진입조건 Then{
if entry == 0 Then
buy("b1");
if (entry == 1 and MarketPosition == -1 and C > EntryPrice-1 and C < EntryPrice) or
(entry == 1 and MarketPosition == 0 and PositionProfit(1) < 1 and PositionProfit(1) > 0) Then
buy("b21");
if (entry == 1 and MarketPosition == -1 and C >= EntryPrice) or
(entry == 1 and MarketPosition == 0 and PositionProfit(1) <= 0) Then
buy("b22");
if (entry == 2 and PL1 < 0) Then
buy("b3");
if MarketPosition == -1 Then
ExitShort("sx");
}
if 매도진입조건 Then{
if entry == 0 Then
sell("s1");
if (entry == 1 and MarketPosition == 1 and C < EntryPrice+1 and C > EntryPrice) or
(entry == 1 and MarketPosition == 0 and PositionProfit(1) < 1) Then
sell("s21");
if (entry == 1 and MarketPosition == 1 and C <= EntryPrice) or
(entry == 1 and MarketPosition == 0 and PositionProfit(1) <= 0) Then
sell("s22");
if (entry == 2 and PL1 < 0) Then
sell("s3");
if MarketPosition == 1 Then
ExitLong("bx");
}
if MarketPosition == 1 then{
if entry >= 2 and (IsEntryName("b22") or IsEntryName("b3")) then
exitlong("bp",Atlimit,EntryPrice+abs(PL1*0.5));
}
if MarketPosition == -1 then{
if entry >= 2 and (IsEntryName("s22") or IsEntryName("s3")) then
ExitShort("sp",Atlimit,EntryPrice-abs(PL1*0.5));
}
즐거운 하루되세요
> 초보자 님이 쓴 글입니다.
> 제목 : Re : Re : 수식문의
> 당일매매 첫번째 매매 이익이 1P 이하이면
당일 매매는 두번만 진입하고 매매종료 하는식하고
만약 매매 첫번째 매매가 손실이면 두번째 진입후
첫번째 손실의 50% 이익이나면 청산
그리고 세번째 진입후 첫번째 손실의 50% 이익이나면 청산
두번째 세번째 진입이 손실이 나도
당일 매매는 세번만 진입하고 매매종료 하는식
두개의 식이 아니라 하나의 식으로 부탁드리고
매수청산 매도 청산식도 포함해 주시기 바랍니다.
수고하십시요.
다음글
이전글