커뮤니티
55546번 재문의 못보고 지나가시는 것 같아서
2017-11-20 10:51:58
109
글번호 114321
안녕하세요?
55646번 재문의 드렸는데, 못 보고 지나가시는 것 같아서 여기다 상기 차원에서 글 남깁니다.
감사합니다.
답변 1
예스스탁 예스스탁 답변
2017-11-21 12:40:10
안녕하세요
예스스탁입니다.
1.
Input: SL1(100), TP1(100),기본수량(1);
var : vol(1);
if TotalTrades > TotalTrades[1] Then{
if IsExitName("bl",1) or IsExitName("sl",1) Then
vol = MaxContracts(1)*2;
Else
vol = 기본수량;
}
if MarketPosition == 0 and ma(C, 10) > ma(C, 30) Then{
buy("b",OnClose,def,vol);
}
if MarketPosition == 0 and ma(C, 10) < ma(C, 30) Then
sell("s",OnClose,def,vol);
if MarketPosition == 1 Then
{
ExitLong("bp",atlimit,EntryPrice+PriceScale*tp1);
ExitLong("bl",AtStop,EntryPrice-PriceScale*sl1);
}
if MarketPosition == -1 Then
{
ExitShort("sp",atlimit,EntryPrice-PriceScale*tp1);
ExitShort("sl",AtStop,EntryPrice+PriceScale*sl1);
}
2
Input: SL1(100), TP1(100),Stp(50);
Array : LL[10](0);
LL[0] = 1;
LL[1] = 2;
LL[2] = 4;
LL[3] = 8;
LL[4] = 16;
LL[5] = 32;
LL[6] = 64;
LL[7] = 128;
LL[8] = 256;
LL[9] = 512;
if MarketPosition == 0 and ma(C, 10) > ma(C, 30) Then{
buy("b",OnClose,def,LL[0]);
}
if MarketPosition == 0 and ma(C, 10) < ma(C, 30) Then
sell("s",OnClose,def,LL[0]);
if MarketPosition == 1 Then
{
buy("bb",Atlimit,LatestEntryPrice(0)-PriceScale*Stp,LL[MaxEntries]);
ExitLong("bp",atlimit,avgEntryPrice+PriceScale*tp1);
if MaxEntries == 10 Then
ExitLong("bl",AtStop,avgEntryPrice-PriceScale*sl1);
}
if MarketPosition == -1 Then
{
sell("ss",atlimit,LatestEntryPrice(0)+PriceScale*Stp,LL[MaxEntries]);
ExitShort("sp",atlimit,AvgEntryPrice+PriceScale*tp1);
if MaxEntries == 10 Then
ExitShort("sl",AtStop,AvgEntryPrice+PriceScale*sl1);
}
즐거운 하루되세요
> 에구머니 님이 쓴 글입니다.
> 제목 : 55546번 재문의 못보고 지나가시는 것 같아서
> 안녕하세요?
55646번 재문의 드렸는데, 못 보고 지나가시는 것 같아서 여기다 상기 차원에서 글 남깁니다.
감사합니다.