커뮤니티
부탁드립니다.
2018-08-10 11:05:23
127
글번호 121272
감사합니다.
아래식에서 익절(30)은 30틱츨 나타냅니다.
차트별 종목이 다른 틱가치에 따라 금액으로 표헌하고 차트 종목별 틱가치에 따라 틱으로 자동변환되게 수식을 수정 부탁드립니다.
하나의 설정값($)으로 여러차트, 다른종목에 적용하고 싶습니다.
예)
Input: 익절(300), 손절(300); ##300$ 금액으로 입력
차트1(골드): 익절: 30틱, 손절: 30틱 으로 적용됨
차트2(나스닥): 익절: 60틱, 손절: 60틱 으로 적용됨
식)-----------------------
input: 익절(30), 손절(30);
Input : BH(0), HE(0), SL(0), LE(0);
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*익절 then{
ExitLong("B익절%",AtStop,BH-(BH-EntryPrice)*0.1);
}
ExitLong("B손절",AtStop,HE-PriceScale*손절);
}
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*익절 then{
ExitShort("S익절%",AtStop,SL+(EntryPrice-SL)*0.1);
}
ExitShort("S손절",AtStop,LE+PriceScale*손절);
}
답변 1
예스스탁 예스스탁 답변
2018-08-10 15:14:06
안녕하세요
예스스탁입니다.
input: 익절(300), 손절(300);
Input : BH(0), HE(0), SL(0), LE(0);
var : profit(0),loss(0);
Profit = 익절/PointValue;
loss = 손절/PointValue;
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*Profit then{
ExitLong("B익절%",AtStop,BH-(BH-EntryPrice)*0.1);
}
ExitLong("B손절",AtStop,HE-PriceScale*loss);
}
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*Profit then{
ExitShort("S익절%",AtStop,SL+(EntryPrice-SL)*0.1);
}
ExitShort("S손절",AtStop,LE+PriceScale*loss);
}
즐거운 하루되세요
> 라떼처럼 님이 쓴 글입니다.
> 제목 : 부탁드립니다.
> 감사합니다.
아래식에서 익절(30)은 30틱츨 나타냅니다.
차트별 종목이 다른 틱가치에 따라 금액으로 표헌하고 차트 종목별 틱가치에 따라 틱으로 자동변환되게 수식을 수정 부탁드립니다.
하나의 설정값($)으로 여러차트, 다른종목에 적용하고 싶습니다.
예)
Input: 익절(300), 손절(300); ##300$ 금액으로 입력
차트1(골드): 익절: 30틱, 손절: 30틱 으로 적용됨
차트2(나스닥): 익절: 60틱, 손절: 60틱 으로 적용됨
식)-----------------------
input: 익절(30), 손절(30);
Input : BH(0), HE(0), SL(0), LE(0);
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*익절 then{
ExitLong("B익절%",AtStop,BH-(BH-EntryPrice)*0.1);
}
ExitLong("B손절",AtStop,HE-PriceScale*손절);
}
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*익절 then{
ExitShort("S익절%",AtStop,SL+(EntryPrice-SL)*0.1);
}
ExitShort("S손절",AtStop,LE+PriceScale*손절);
}
다음글
이전글