커뮤니티
수식 부탁드립니다
2017-02-19 09:44:12
108
글번호 106973
1. entryprice 는 최초 진입가이고
latestentryprice 는 최종 진입가인데
최초 진입후 최초 진입가가 수익 목표가에서 청산된 경우 피라미딩 후 청산되지 않고 계
속보유중인 가격 중 최저가를 나타내는 명령어가 있나요?
이 질문에 답변을 해주셔서 당초 시스템식
if MarketPosition == 1 Then
{
if MaxContracts < 4 Then
buy("bb",atstop,LatestEntryPrice(0)+1.5,1);
}
if MarketPosition == -1 Then
{
if MaxContracts < 4 Then
sell("ss",atstop,LatestEntryPrice(0)-1.5,1);
}
#진입별 5포인트 수익시 청산
SetStopProfittarget(5.0,PointStop);
#진입별 1.5포인트 손실시 청산
SetStoploss(1.5,PointStop);
if MarketPosition == 1 Then
ExitLong("bp",atlimit,EntryPrice+20.0);
if MarketPosition == -1 Then
ExitShort("sp",atlimit,EntryPrice-20.0);
if MarketPosition == 1 and c > entryprice + 15.0 and Relative1 >= 65 Then
exitlong("bx1",AtStop,c);
if MarketPosition == -1 and c < entryprice - 15.0 and Relative1 <= 35 Then
exitShort("sx1",AtStop,c);
if MarketPosition == 1 and highest(h,BarsSinceEntry) >= EntryPrice + 0.6 Then
Exitlong("bx2",AtStop,highest(H,BarsSinceEntry) - abs(highest(H,BarsSinceEntry)-EntryPrice)*1.0);
if MarketPosition == -1 and lowest(L,BarsSinceEntry) <= EntryPrice - 0.6 Then
Exitshort("Sx2",AtStop,lowest(L,BarsSinceEntry) + abs(lowest(L,BarsSinceEntry)-EntryPrice)*1.0);
if MarketPosition == 1 and highest(h,BarsSinceEntry) >= EntryPrice + 1.0 Then
Exitlong("bx3",AtStop,highest(H,BarsSinceEntry) - abs(highest(H,BarsSinceEntry)-EntryPrice)*0.9);
if MarketPosition == -1 and lowest(L,BarsSinceEntry) <= EntryPrice - 1.0 Then
Exitshort("Sx3",AtStop,lowest(L,BarsSinceEntry) + abs(lowest(L,BarsSinceEntry)-EntryPrice)*0.9);
을 다음과 같이 바꾸었습니다
if MarketPosition == 1 Then
{
if MaxContracts < 4 Then
buy("bb",atstop,LatestEntryPrice(0)+1.5,1);
}
if MarketPosition == -1 Then
{
if MaxContracts < 4 Then
sell("ss",atstop,LatestEntryPrice(0)-1.5,1);
}
If MarketPosition == -1 Then
{
if MaxEntries == 1 Then LL = EntryPrice;
if CurrentContracts > CurrentContracts[1] and LatestEntryPrice(0) > LL Then
LL = LatestEntryPrice(0);
}
#진입별 5포인트 수익시 청산
SetStopProfittarget(5.0,PointStop);
#진입별 1.5포인트 손실시 청산
SetStoploss(1.5,PointStop);
if MarketPosition == 1 Then
ExitLong("bp",atlimit,EntryPrice+20);
if MarketPosition == -1 Then
ExitShort("sp",atlimit,EntryPrice-20);
if MarketPosition == 1 and c > entryprice + 15.0 and Relative1 >= 65 Then
exitlong("bx1",AtStop,c);
if MarketPosition == -1 and c < EntryPrice - 15.0 and Relative1 <= 35 Then
exitShort("sx1",AtStop,c);
if MarketPosition == 1 and CurrentContracts == 1 and highest(h,BarsSinceEntry) >= LL + 0.6 Then
Exitlong("bx2",AtStop,highest(H,BarsSinceEntry) - abs(highest(H,BarsSinceEntry)- LL)*1.0);
if MarketPosition == -1 and CurrentContracts == 1 and lowest(L,BarsSinceEntry) <= LL - 0.6 Then
Exitshort("Sx2",AtStop,lowest(L,BarsSinceEntry) + abs(lowest(L,BarsSinceEntry)- LL)*1.0);
if MarketPosition == 1 and CurrentContracts <= 2 and highest(h,BarsSinceEntry) >= LL-1.0 Then
Exitlong("bx3",AtStop,highest(H,BarsSinceEntry) - abs(highest(H,BarsSinceEntry)- LL)*0.9);
if MarketPosition == -1 and CurrentContracts <= 2 and lowest(L,BarsSinceEntry) <= LL- 1.0 Then
Exitshort("Sx3",AtStop,lowest(L,BarsSinceEntry) + abs(lowest(L,BarsSinceEntry)- LL)*0.9);
바꾼 결과는 당초와 다른것이 하나도 없었습니다.
더 바꿔야 하는 수식이 있는지 검토 부탁드립니다
2. entryprice 는 최초 진입가이고
latestentryprice 는 최종 진입가인데
피라미딩 후 청산되지 않고 보유중인 계약이 다수 있을경우 각 가격을 나타내는 명령어가 있
나요?
3. 또 위의 피라미딩 시스템은 4개의 잔량까지 보유 할 수 있는데 보유중인 가격중 하위 2개, 또는 3개 가격의 평균가(avgentryprice)을 나타내는 명령어를 만들고 싶습니다
감사합니다
답변 2
예스스탁 예스스탁 답변
2017-02-20 14:10:32
안녕하세요
예스스탁입니다.
1.
LatestEntryPrice(0)가 LL보다 작다라고 하셔야 합니다.
If MarketPosition != 0 Then
{
if MaxEntries == 1 Then
LL = EntryPrice;
if CurrentContracts > CurrentContracts[1] and LatestEntryPrice(0) < LL Then
LL = LatestEntryPrice(0);
}
2
없습니다.
3
아래 내용 참고하시기 바랍니다.
var : E1(0),E2(0),E3(0),E4(0),avg2(0),avg3(0);
If MarketPosition != 0 Then
{
if CurrentContracts > CurrentContracts[1] Then{
if MaxEntries == 1 Then
E1 = LatestEntryPrice(0);
if MaxEntries == 2 Then
E2 = LatestEntryPrice(0);
if MaxEntries == 3 Then
E3 = LatestEntryPrice(0);
if MaxEntries == 4 Then
E4 = LatestEntryPrice(0);
}
if MaxEntries == 1 Then{
avg2 = E1;
avg3 = E1;
}
if MaxEntries == 2 Then{
avg2 = (E1+E2)/2;
avg3 = (E1+E2)/2;
}
if MaxEntries == 3 Then{
avg2 = (NthMinList(1,E1,E2,E3)+NthMinList(2,E1,E2,E3))/2;
avg3 = (E1+E2+E3)/3;
}
if MaxEntries == 4 Then{
avg2 = (NthMinList(1,E1,E2,E3,E4)+NthMinList(2,E1,E2,E3,E4))/2;
avg3 = (NthMinList(1,E1,E2,E3,E4)+NthMinList(2,E1,E2,E3,E4)+NthMinList(3,E1,E2,E3,E4))/3;
}
}
즐거운 하루되세요
> 미송 님이 쓴 글입니다.
> 제목 : 수식 부탁드립니다
> 1. entryprice 는 최초 진입가이고
latestentryprice 는 최종 진입가인데
최초 진입후 최초 진입가가 수익 목표가에서 청산된 경우 피라미딩 후 청산되지 않고 계
속보유중인 가격 중 최저가를 나타내는 명령어가 있나요?
이 질문에 답변을 해주셔서 당초 시스템식
if MarketPosition == 1 Then
{
if MaxContracts < 4 Then
buy("bb",atstop,LatestEntryPrice(0)+1.5,1);
}
if MarketPosition == -1 Then
{
if MaxContracts < 4 Then
sell("ss",atstop,LatestEntryPrice(0)-1.5,1);
}
#진입별 5포인트 수익시 청산
SetStopProfittarget(5.0,PointStop);
#진입별 1.5포인트 손실시 청산
SetStoploss(1.5,PointStop);
if MarketPosition == 1 Then
ExitLong("bp",atlimit,EntryPrice+20.0);
if MarketPosition == -1 Then
ExitShort("sp",atlimit,EntryPrice-20.0);
if MarketPosition == 1 and c > entryprice + 15.0 and Relative1 >= 65 Then
exitlong("bx1",AtStop,c);
if MarketPosition == -1 and c < entryprice - 15.0 and Relative1 <= 35 Then
exitShort("sx1",AtStop,c);
if MarketPosition == 1 and highest(h,BarsSinceEntry) >= EntryPrice + 0.6 Then
Exitlong("bx2",AtStop,highest(H,BarsSinceEntry) - abs(highest(H,BarsSinceEntry)-EntryPrice)*1.0);
if MarketPosition == -1 and lowest(L,BarsSinceEntry) <= EntryPrice - 0.6 Then
Exitshort("Sx2",AtStop,lowest(L,BarsSinceEntry) + abs(lowest(L,BarsSinceEntry)-EntryPrice)*1.0);
if MarketPosition == 1 and highest(h,BarsSinceEntry) >= EntryPrice + 1.0 Then
Exitlong("bx3",AtStop,highest(H,BarsSinceEntry) - abs(highest(H,BarsSinceEntry)-EntryPrice)*0.9);
if MarketPosition == -1 and lowest(L,BarsSinceEntry) <= EntryPrice - 1.0 Then
Exitshort("Sx3",AtStop,lowest(L,BarsSinceEntry) + abs(lowest(L,BarsSinceEntry)-EntryPrice)*0.9);
을 다음과 같이 바꾸었습니다
if MarketPosition == 1 Then
{
if MaxContracts < 4 Then
buy("bb",atstop,LatestEntryPrice(0)+1.5,1);
}
if MarketPosition == -1 Then
{
if MaxContracts < 4 Then
sell("ss",atstop,LatestEntryPrice(0)-1.5,1);
}
If MarketPosition == -1 Then
{
if MaxEntries == 1 Then LL = EntryPrice;
if CurrentContracts > CurrentContracts[1] and LatestEntryPrice(0) > LL Then
LL = LatestEntryPrice(0);
}
#진입별 5포인트 수익시 청산
SetStopProfittarget(5.0,PointStop);
#진입별 1.5포인트 손실시 청산
SetStoploss(1.5,PointStop);
if MarketPosition == 1 Then
ExitLong("bp",atlimit,EntryPrice+20);
if MarketPosition == -1 Then
ExitShort("sp",atlimit,EntryPrice-20);
if MarketPosition == 1 and c > entryprice + 15.0 and Relative1 >= 65 Then
exitlong("bx1",AtStop,c);
if MarketPosition == -1 and c < EntryPrice - 15.0 and Relative1 <= 35 Then
exitShort("sx1",AtStop,c);
if MarketPosition == 1 and CurrentContracts == 1 and highest(h,BarsSinceEntry) >= LL + 0.6 Then
Exitlong("bx2",AtStop,highest(H,BarsSinceEntry) - abs(highest(H,BarsSinceEntry)- LL)*1.0);
if MarketPosition == -1 and CurrentContracts == 1 and lowest(L,BarsSinceEntry) <= LL - 0.6 Then
Exitshort("Sx2",AtStop,lowest(L,BarsSinceEntry) + abs(lowest(L,BarsSinceEntry)- LL)*1.0);
if MarketPosition == 1 and CurrentContracts <= 2 and highest(h,BarsSinceEntry) >= LL-1.0 Then
Exitlong("bx3",AtStop,highest(H,BarsSinceEntry) - abs(highest(H,BarsSinceEntry)- LL)*0.9);
if MarketPosition == -1 and CurrentContracts <= 2 and lowest(L,BarsSinceEntry) <= LL- 1.0 Then
Exitshort("Sx3",AtStop,lowest(L,BarsSinceEntry) + abs(lowest(L,BarsSinceEntry)- LL)*0.9);
바꾼 결과는 당초와 다른것이 하나도 없었습니다.
더 바꿔야 하는 수식이 있는지 검토 부탁드립니다
2. entryprice 는 최초 진입가이고
latestentryprice 는 최종 진입가인데
피라미딩 후 청산되지 않고 보유중인 계약이 다수 있을경우 각 가격을 나타내는 명령어가 있
나요?
3. 또 위의 피라미딩 시스템은 4개의 잔량까지 보유 할 수 있는데 보유중인 가격중 하위 2개, 또는 3개 가격의 평균가(avgentryprice)을 나타내는 명령어를 만들고 싶습니다
감사합니다
미송
2017-02-20 20:09:42
미송 님에 의해 삭제된 답변입니다.