예스스탁
예스스탁 답변
2016-04-04 18:20:37
안녕하세요
예스스탁입니다.
1.
var : T(0);
var1 = ma(C,20);
var2 = ma(C,60);
if var2 > var2[1] Then
T = 1;
if var2 < var2[1] Then
T = -1;
if stime >= 230000 or stime < 030000 then{
if MarketPosition <= 0 and T == 1 and NextBarOpen < var1 Then
buy("b",AtStop,NextBarOpen+PriceScale*3,2);
if MarketPosition >= 0 and T == -1 and NextBarOpen > var1 Then
sell("s",AtStop,NextBarOpen-PriceScale*3,2);
}
if MarketPosition == 1 Then{
ExitLong("bp1",AtLimit,EntryPrice+PriceScale*50,"",1,1);
ExitLong("bp2",AtLimit,EntryPrice+PriceScale*100);
ExitLong("bl",AtStop,EntryPrice-PriceScale*25);
if CurrentContracts == MaxContracts and highest(H,BarsSinceEntry) >= EntryPrice+PriceScale*20 Then{
ExitLong("bx1",AtStop,EntryPrice+PriceScale*1);
}
if CurrentContracts < MaxContracts Then{
ExitLong("bx2",AtStop,EntryPrice+PriceScale*1);
}
}
if MarketPosition == -1 Then{
ExitShort("sp1",AtLimit,EntryPrice-PriceScale*50,"",1,1);
ExitShort("sp2",AtLimit,EntryPrice-PriceScale*100);
ExitShort("sl",AtStop,EntryPrice+PriceScale*25);
if CurrentContracts == MaxContracts and Lowest(L,BarsSinceEntry) <= EntryPrice-PriceScale*20 Then{
ExitShort("sx1",AtStop,EntryPrice-PriceScale*1);
}
if CurrentContracts < MaxContracts Then{
ExitShort("sx2",AtStop,EntryPrice-PriceScale*1);
}
}
2.
var : T(0);
var1 = ma(C,20);
var2 = ma(C,60);
if var2 > var2[1] Then
T = 1;
if var2 < var2[1] Then
T = -1;
if stime >= 230000 or stime < 030000 then{
if MarketPosition <= 0 and T == 1 and NextBarOpen < var1 Then
buy("b",AtStop,NextBarOpen+PriceScale*3,1);
if MarketPosition >= 0 and T == -1 and NextBarOpen > var1 Then
sell("s",AtStop,NextBarOpen-PriceScale*3,1);
}
if MarketPosition == 1 Then{
ExitLong("bp",AtLimit,EntryPrice+PriceScale*50);
ExitLong("bl",AtStop,EntryPrice-PriceScale*25);
if highest(H,BarsSinceEntry) >= EntryPrice+PriceScale*20 Then{
ExitLong("bx1",AtStop,EntryPrice+PriceScale*1);
}
if CurrentContracts < MaxContracts Then{
ExitLong("bx2",AtStop,EntryPrice+PriceScale*1);
}
}
if MarketPosition == -1 Then{
ExitShort("sp",AtLimit,EntryPrice-PriceScale*50);
ExitShort("sl",AtStop,EntryPrice+PriceScale*25);
if Lowest(L,BarsSinceEntry) <= EntryPrice-PriceScale*20 Then{
ExitShort("sx1",AtStop,EntryPrice-PriceScale*1);
}
}
즐거운 하루되세요
> 상중하 님이 쓴 글입니다.
> 제목 : 수식부탁드립니다.
> 안녕하세요?
시스템 트레이딩을 입문한지 얼마안된 초보입니다.
여기보니 간단한 코딩을 해주시는것 같아 질문 드립니다.
매수조건;
60MA 기울기가 상승이고 20MA 아래에서 시가가 형성되고 시가 +3틱에서 매수
매도조건;
60MA 기울기가 하락이고 20MA 위에서 시가가 형성되고 시가 -3틱에서 매도
매매시간;
21:00~03:00
매매조건
2계약 진입합니다. (단타1계약,추세1계약)
1)수익청산은 단타 +50틱,추세+100틱.
단타 수익청산후 추세포는 진입가+1틱에 본청설정.
2)+20틱 수익후 진입가+1틱에 본청설정(2계약).
3) -25틱에 손절설정(2계약)
참고 화면캡쳐 첨부했습니다.
-----------------------------------------------------------------------------
단계약도 부탁드립니다.
매수,매도조건,매매시간은 같습니다.
매매조건에서 한계약진입합니다.
수익청산은 +50틱,손절-25틱.
+20틱 수익후 진입가+1틱에 본청설정
수식에 주석도 달아주시면 고맙겠습니다.
주말에 예제들을 보고 만들려고 했지만 잘안되어서 문의 드립니다.
감사합니다.