커뮤니티
수식요청드립니다.
2018-08-02 14:58:07
175
글번호 121094
아래식을 아래와 같이 수정요청드립니다. 감사합니다.
진입가 대비 3% 상승하면, 최고 익절틱 대비 20% 떨어지면 청산,(매수,매도청산)
예) 1000(진입가) --> 1030(3%상승) --> 1050(최고값) --> 1040(50틱대비20%하락) 청산
if MarketPosition == 1 Then{
BH = highest(H,BarsSinceEntry);
if MaxEntries == 1 Then
HE = LatestEntryPrice(0);
if MaxEntries >= 2 and LatestEntryPrice(0) > HE Then
HE = LatestEntryPrice(0);
if BH >= EntryPrice+PriceScale*30 then{
ExitLong("B익절%",AtStop,BH-(BH-EntryPrice)*0.1);
}
ExitLong("B손절",AtStop,HE-PriceScale*30);
}
if MarketPosition == -1 Then{
SL = Lowest(L,BarsSinceEntry);
if MaxEntries == 1 Then
LE = LatestEntryPrice(0);
if MaxEntries >= 2 and LatestEntryPrice(0) < LE Then
LE = LatestEntryPrice(0);
if SL <= EntryPrice-PriceScale*30 then{
ExitShort("S익절%",AtStop,SL+(EntryPrice-SL)*0.1);
}
ExitShort("S손절",AtStop,LE+PriceScale*30);
}
답변 1
예스스탁 예스스탁 답변
2018-08-03 09:10:00
안녕하세요
예스스탁입니다.
if MarketPosition == 1 Then{
BH = highest(H,BarsSinceEntry);
if MaxEntries == 1 Then
HE = LatestEntryPrice(0);
if MaxEntries >= 2 and LatestEntryPrice(0) > HE Then
HE = LatestEntryPrice(0);
if BH >= EntryPrice*1.03 then{
ExitLong("B익절%",AtStop,BH-(BH-EntryPrice)*0.2);
}
ExitLong("B손절",AtStop,HE-PriceScale*30);
}
if MarketPosition == -1 Then{
SL = Lowest(L,BarsSinceEntry);
if MaxEntries == 1 Then
LE = LatestEntryPrice(0);
if MaxEntries >= 2 and LatestEntryPrice(0) < LE Then
LE = LatestEntryPrice(0);
if SL <= EntryPrice*0.97then{
ExitShort("S익절%",AtStop,SL+(EntryPrice-SL)*0.2);
}
ExitShort("S손절",AtStop,LE+PriceScale*30);
}
즐거운 하루되세요
> 라떼처럼 님이 쓴 글입니다.
> 제목 : 수식요청드립니다.
> 아래식을 아래와 같이 수정요청드립니다. 감사합니다.
진입가 대비 3% 상승하면, 최고 익절틱 대비 20% 떨어지면 청산,(매수,매도청산)
예) 1000(진입가) --> 1030(3%상승) --> 1050(최고값) --> 1040(50틱대비20%하락) 청산
if MarketPosition == 1 Then{
BH = highest(H,BarsSinceEntry);
if MaxEntries == 1 Then
HE = LatestEntryPrice(0);
if MaxEntries >= 2 and LatestEntryPrice(0) > HE Then
HE = LatestEntryPrice(0);
if BH >= EntryPrice+PriceScale*30 then{
ExitLong("B익절%",AtStop,BH-(BH-EntryPrice)*0.1);
}
ExitLong("B손절",AtStop,HE-PriceScale*30);
}
if MarketPosition == -1 Then{
SL = Lowest(L,BarsSinceEntry);
if MaxEntries == 1 Then
LE = LatestEntryPrice(0);
if MaxEntries >= 2 and LatestEntryPrice(0) < LE Then
LE = LatestEntryPrice(0);
if SL <= EntryPrice-PriceScale*30 then{
ExitShort("S익절%",AtStop,SL+(EntryPrice-SL)*0.1);
}
ExitShort("S손절",AtStop,LE+PriceScale*30);
}