커뮤니티
문의드립니다
2016-09-22 23:19:52
134
글번호 102141
1.
input : 진입수량(4),목표틱수1(5),목표틱수2(10),목표틱수3(15),목표틱수4(20);
var42 = ma(C,100);
if MarketPosition <= 0 and
TotalTrades == TotalTrades[1] and
var42 > var42[1] Then{
buy("b",OnClose,def,진입수량);
ExitLong("bx1.",atlimit,C+PriceScale*목표틱수1,"",1,1);
ExitLong("bx2.",atlimit,C+PriceScale*목표틱수2,"",1,1);
ExitLong("bx3.",atlimit,C+PriceScale*목표틱수3,"",1,1);
ExitLong("bx4.",atlimit,C+PriceScale*목표틱수4,"",1,1);
}
if MarketPosition >= 0 and
TotalTrades == TotalTrades[1] and
var42 < var42[1] Then{
sell("s",OnClose,def,진입수량);
ExitShort("sx1.",atlimit,C-PriceScale*목표틱수1,"",1,1);
ExitShort("sx2.",atlimit,C-PriceScale*목표틱수2,"",1,1);
ExitShort("sx3.",atlimit,C-PriceScale*목표틱수3,"",1,1);
ExitShort("sx4.",atlimit,C-PriceScale*목표틱수4,"",1,1);
}
if MarketPosition == 1 Then{
if highest(H,BarsSinceEntry) < EntryPrice+PriceScale*목표틱수1 Then
ExitLong("bx1",atlimit,EntryPrice+PriceScale*목표틱수1,"",1,1);
if highest(H,BarsSinceEntry) < EntryPrice+PriceScale*목표틱수2 Then
ExitLong("bx2",atlimit,EntryPrice+PriceScale*목표틱수2,"",1,1);
if highest(H,BarsSinceEntry) < EntryPrice+PriceScale*목표틱수3 Then
ExitLong("bx3",atlimit,EntryPrice+PriceScale*목표틱수3,"",1,1);
if highest(H,BarsSinceEntry) < EntryPrice+PriceScale*목표틱수4 Then
ExitLong("bx4",atlimit,EntryPrice+PriceScale*목표틱수4,"",1,1);
}
if MarketPosition == -1 Then{
if Lowest(L,BarsSinceEntry) > EntryPrice-PriceScale*목표틱수1 Then
ExitShort("sx1",atlimit,EntryPrice-PriceScale*목표틱수1,"",1,1);
if Lowest(L,BarsSinceEntry) > EntryPrice-PriceScale*목표틱수2 Then
ExitShort("sx2",atlimit,EntryPrice-PriceScale*목표틱수2,"",1,1);
if Lowest(L,BarsSinceEntry) > EntryPrice-PriceScale*목표틱수3 Then
ExitShort("sx3",atlimit,EntryPrice-PriceScale*목표틱수3,"",1,1);
if Lowest(L,BarsSinceEntry) > EntryPrice-PriceScale*목표틱수4 Then
ExitShort("sx4",atlimit,EntryPrice-PriceScale*목표틱수4,"",1,1);
}
정말감사합니다..항상
다름이아니라..이부분에 목표수익을 넣고싶습니다
1.예시: 위 분할청산 하는 거에 각각 제가 원하는 수익을 얻었을경우
목표수익(외부변수) 를 이용하여 더이상 신호가 발생 안되게
만들고싶습니다
분할 청산후 예:50만원을 수익을 얻었을경우 신호발생 X
2.혹시 분활청산될때 색깔 지정이 안된다면
모양을 넣을수 있는지 궁금합니다
예시: 1차청산에 동그라미 2차청산에 세모
3차청산에 네모 4차청산에 별표
가능하다면 수식좀부탁드립니다
당분간은 문의가 없을듯합니다 ..감사합니다..좋은하루되세요..
답변 1
예스스탁 예스스탁 답변
2016-09-23 15:14:32
안녕하세요
예스스탁입니다.
1
input : 진입수량(4),목표틱수1(5),목표틱수2(10),목표틱수3(15),목표틱수4(20),당일수익(500000);
var : NP(0),NP1(0),DayPl(0),DP(0),Xcond(false);
NP = NetProfit;
DP = (당일수익/BigPointValue);
if Bdate != Bdate[1] Then{
NP1 = NP;
Xcond = false;
}
DayPL = NP-NP1;
if TotalTrades > TotalTrades[1] and (IsExitName("bx",1) or IsExitName("sx",1)) Then
Xcond = true;
var42 = ma(C,100);
if MarketPosition <= 0 and Xcond == false and
TotalTrades == TotalTrades[1] and
var42 > var42[1] Then{
buy("b",OnClose,def,진입수량);
ExitLong("B■.",atlimit,C+PriceScale*목표틱수1,"",1,1);
ExitLong("B▲.",atlimit,C+PriceScale*목표틱수2,"",1,1);
ExitLong("B●.",atlimit,C+PriceScale*목표틱수3,"",1,1);
ExitLong("B★.",atlimit,C+PriceScale*목표틱수4,"",1,1);
}
if MarketPosition >= 0 and Xcond == false and
TotalTrades == TotalTrades[1] and
var42 < var42[1] Then{
sell("s",OnClose,def,진입수량);
ExitShort("S■ ",atlimit,C-PriceScale*목표틱수1,"",1,1);
ExitShort("S▲ ",atlimit,C-PriceScale*목표틱수2,"",1,1);
ExitShort("S● ",atlimit,C-PriceScale*목표틱수3,"",1,1);
ExitShort("S★ ",atlimit,C-PriceScale*목표틱수4,"",1,1);
}
if MarketPosition == 1 Then{
ExitLong("bx",Atlimit,EntryPrice+DP-DayPL);
if highest(H,BarsSinceEntry) < EntryPrice+PriceScale*목표틱수1 Then
ExitLong("B■",atlimit,EntryPrice+PriceScale*목표틱수1,"",1,1);
if highest(H,BarsSinceEntry) < EntryPrice+PriceScale*목표틱수2 Then
ExitLong("B▲",atlimit,EntryPrice+PriceScale*목표틱수2,"",1,1);
if highest(H,BarsSinceEntry) < EntryPrice+PriceScale*목표틱수3 Then
ExitLong("B●",atlimit,EntryPrice+PriceScale*목표틱수3,"",1,1);
if highest(H,BarsSinceEntry) < EntryPrice+PriceScale*목표틱수4 Then
ExitLong("B★",atlimit,EntryPrice+PriceScale*목표틱수4,"",1,1);
}
if MarketPosition == -1 Then{
ExitShort("sx",Atlimit,EntryPrice-DP+DayPL);
if Lowest(L,BarsSinceEntry) > EntryPrice-PriceScale*목표틱수1 Then
ExitShort("S■",atlimit,EntryPrice-PriceScale*목표틱수1,"",1,1);
if Lowest(L,BarsSinceEntry) > EntryPrice-PriceScale*목표틱수2 Then
ExitShort("S▲",atlimit,EntryPrice-PriceScale*목표틱수2,"",1,1);
if Lowest(L,BarsSinceEntry) > EntryPrice-PriceScale*목표틱수3 Then
ExitShort("S●",atlimit,EntryPrice-PriceScale*목표틱수3,"",1,1);
if Lowest(L,BarsSinceEntry) > EntryPrice-PriceScale*목표틱수4 Then
ExitShort("S★",atlimit,EntryPrice-PriceScale*목표틱수4,"",1,1);
}
2
화살표의 색이나 모양은 따로 지정할수는 없습니다.
위와 같이 이름에 윈도우 특수문자를 이용해 청산명을 지정해
표시해 볼수는 있습니다.
매수청산과 매도청산에 동일문자를 넣을 수 없으므로
매수청산은 B+문자, 매도청산은 S+문자로 지정했습니다.
즐거운 하루되세요
> 곽민수 님이 쓴 글입니다.
> 제목 : 문의드립니다
> 1.
input : 진입수량(4),목표틱수1(5),목표틱수2(10),목표틱수3(15),목표틱수4(20);
var42 = ma(C,100);
if MarketPosition <= 0 and
TotalTrades == TotalTrades[1] and
var42 > var42[1] Then{
buy("b",OnClose,def,진입수량);
ExitLong("bx1.",atlimit,C+PriceScale*목표틱수1,"",1,1);
ExitLong("bx2.",atlimit,C+PriceScale*목표틱수2,"",1,1);
ExitLong("bx3.",atlimit,C+PriceScale*목표틱수3,"",1,1);
ExitLong("bx4.",atlimit,C+PriceScale*목표틱수4,"",1,1);
}
if MarketPosition >= 0 and
TotalTrades == TotalTrades[1] and
var42 < var42[1] Then{
sell("s",OnClose,def,진입수량);
ExitShort("sx1.",atlimit,C-PriceScale*목표틱수1,"",1,1);
ExitShort("sx2.",atlimit,C-PriceScale*목표틱수2,"",1,1);
ExitShort("sx3.",atlimit,C-PriceScale*목표틱수3,"",1,1);
ExitShort("sx4.",atlimit,C-PriceScale*목표틱수4,"",1,1);
}
if MarketPosition == 1 Then{
if highest(H,BarsSinceEntry) < EntryPrice+PriceScale*목표틱수1 Then
ExitLong("bx1",atlimit,EntryPrice+PriceScale*목표틱수1,"",1,1);
if highest(H,BarsSinceEntry) < EntryPrice+PriceScale*목표틱수2 Then
ExitLong("bx2",atlimit,EntryPrice+PriceScale*목표틱수2,"",1,1);
if highest(H,BarsSinceEntry) < EntryPrice+PriceScale*목표틱수3 Then
ExitLong("bx3",atlimit,EntryPrice+PriceScale*목표틱수3,"",1,1);
if highest(H,BarsSinceEntry) < EntryPrice+PriceScale*목표틱수4 Then
ExitLong("bx4",atlimit,EntryPrice+PriceScale*목표틱수4,"",1,1);
}
if MarketPosition == -1 Then{
if Lowest(L,BarsSinceEntry) > EntryPrice-PriceScale*목표틱수1 Then
ExitShort("sx1",atlimit,EntryPrice-PriceScale*목표틱수1,"",1,1);
if Lowest(L,BarsSinceEntry) > EntryPrice-PriceScale*목표틱수2 Then
ExitShort("sx2",atlimit,EntryPrice-PriceScale*목표틱수2,"",1,1);
if Lowest(L,BarsSinceEntry) > EntryPrice-PriceScale*목표틱수3 Then
ExitShort("sx3",atlimit,EntryPrice-PriceScale*목표틱수3,"",1,1);
if Lowest(L,BarsSinceEntry) > EntryPrice-PriceScale*목표틱수4 Then
ExitShort("sx4",atlimit,EntryPrice-PriceScale*목표틱수4,"",1,1);
}
정말감사합니다..항상
다름이아니라..이부분에 목표수익을 넣고싶습니다
1.예시: 위 분할청산 하는 거에 각각 제가 원하는 수익을 얻었을경우
목표수익(외부변수) 를 이용하여 더이상 신호가 발생 안되게
만들고싶습니다
분할 청산후 예:50만원을 수익을 얻었을경우 신호발생 X
2.혹시 분활청산될때 색깔 지정이 안된다면
모양을 넣을수 있는지 궁금합니다
예시: 1차청산에 동그라미 2차청산에 세모
3차청산에 네모 4차청산에 별표
가능하다면 수식좀부탁드립니다
당분간은 문의가 없을듯합니다 ..감사합니다..좋은하루되세요..
이전글