예스스탁
예스스탁 답변
2021-01-18 12:38:46
안녕하세요
예스스탁입니다.
input : short(12),long(26),sig(9);
var : MACDV(0),MACDS(0);
var : T(0);
var : HIV(0),HIV1(0),HPV(0),HPV1(0);
var : LIV(0),LIV1(0),LPV(0),LPV1(0);
MACDV = MACD(short,long);
MACDS = Ema(MACDV,sig);
if crossup(MACDV,MACDS) Then
{
buy("b",OnClose,DEF,2);
}
if CrossDown(MACDV,MACDS) Then
{
sell("s",OnClose,DEF,2);
}
if MarketPosition == 1 Then
{
if CurrentContracts == MaxContracts Then
ExitLong("bx1",AtLimit,EntryPrice+PriceScale*50,"",1,1);
if CurrentContracts == MaxContracts Then
{
ExitLong("bx2",AtLimit,EntryPrice+PriceScale*150);
ExitLong("bx3",AtStop,Highest(H,BarsSinceEntry)-(Highest(H,BarsSinceEntry)-EntryPrice)*0.4);
}
}
if MarketPosition == -1 Then
{
if CurrentContracts == MaxContracts Then
ExitShort("sx1",AtLimit,EntryPrice-PriceScale*50,"",1,1);
if CurrentContracts == MaxContracts Then
{
ExitShort("sx2",AtLimit,EntryPrice-PriceScale*150);
ExitShort("sx3",AtStop,lowest(H,BarsSinceEntry)+(EntryPrice-Lowest(L,BarsSinceEntry))*0.4);
}
}
즐거운 하루되세요
> 오케마컴 님이 쓴 글입니다.
> 제목 : 문의드립니다
> 진입은 두계약으로 macd가 시그널선을 상향돌파 매수 하향돌파 매도
청산은 두계약 따로하고 싶은데 이게 잘 안되네요
첫번째 청산은 진입하고 50틱에 도달하면 청산하고 두번째는 150틱에 청산하되 만약 150틱에 도달 못하면 첫번재 청산후 최고점에서 40프로 다운되면 하고싶거든요. 예를 들면 첫번째 50틱에 청산되고 150틱 도달하면 150틱에 청산하고 150틱 도달못하고 100틱까지 갔다가 60틱으로 내려오면 청산되게 하고 싶습니다. 매도도 같습니다