커뮤니티
옵션매매
2013-12-09 10:51:59
174
글번호 70249
안녕하세요.
아래와 같은 선물전략을 옵션전략으로 변환부탁드립니다.
(ex. Close -> Data2(C) )
아룰러 기준선물차트가 50틱차트라면 옵션도 동일하게 50틱으로 설정하는
것이 좋나요? 선물신호가 나옴과 동시에 옵션에 신호를 발생시키려면
어떤식으로 설정해야 하나요?
그럼 수고하세요.
Input : EntryTime1(90700), EntryTime2(90400);
Var : cnt(0), EntryCount(0), DayGap(0), Signal("");
Var : atrlen(30), ts(3);
DayGap = ABS(DayOpen - DayClose(1));
EntryCount = 0;
For cnt = 0 to 20
{
If Sdate == EntryDate(cnt) Then EntryCount = EntryCount + 1;
}
If Time < EntryTime1 and EntryCount < 1 Then
{
If CrossUp(C, MA(C, 10)) Then Buy("Buy", AtMarket);
If CrossDown(C, MA(C, 10)) Then Sell("Sell", AtMarket);
}
If Time >= 94000 Then
{
If MarketPosition == -1 and EntryCount == 1 Then
{
If PositionProfit < -0.5 Then
{
Buy("손절매수", AtMarket);
}
}
}
If Time >= 90200 Then
{
If MarketPosition == 1 and EntryCount == 1 Then
{
If EntryPrice - lowest(low,barsSinceEntry+1) > 0.8 Then
{
Buy("피라미딩매수",Atstop,lowest(low,barsSinceEntry+1)+atr(30)*3);
}
}
}
SetStopLoss(1.0, PointStop);
SetstopProfittarget(2.0, Pointstop);
If Marketposition == 1 then
{
If highest(high,barsSinceEntry+1) - EntryPrice > ProfitLimit Then
exitlong("매수청산",Atstop,highest(high,barsSinceEntry+1)-atr(atrlen)*ts);
}
If Marketposition ==-1 then
{
If EntryPrice - lowest(low,barsSinceEntry+1) > ProfitLimit Then
exitshort("매도청산",Atstop,lowest(low,barsSinceEntry+1)+atr(atrlen)*ts);
}
If Time >= 131000+TimeDelay Then Begin
ExitShort("DayEnd ExitShort");
ExitLong("DayEnd ExitLong");
End;
답변 1
예스스탁 예스스탁 답변
2013-12-09 15:24:54
안녕하세요
예스스탁입니다.
해당 내용 참조데이터로 변경하면 모두 봉완성시 종가기준으로 작성이 가능합니다.
신호타입중 atstop등은 주종목의 시세와 비교만 하므로
해당 가격 터치시 진입은 가능하지 않습니다.
아래식 참고하시기 바랍니다.
시스템은 주종목의 봉이 완성이 될때
참조데이터의 최종완성봉의 값으로 비교를 합니다.
차트를 동일하게 50틱으로 하시는데 각각 50틱 만들어지는 시간의 차이가 있으므로
실제 원래 선물차트에 거셨던 신호와 차이가 발생할수 있습니다.
Input : EntryTime1(90700), EntryTime2(90400);
Var : cnt(0,data1), EntryCount(0,data1), DayGap(0,data2), Signal("");
Var : atrlen(30), ts(3);
var : D2C(0,data1),D2H(0,data1),D2L(0,data1);
D2C = data2(c);
D2H = data2(h);
D2L = data2(l);
DayGap = ABS(OpenD(0)-CloseD(1));
EntryCount = 0;
For cnt = 0 to 20
{
If Sdate == EntryDate(cnt) Then EntryCount = EntryCount + 1;
}
If Time < EntryTime1 and EntryCount < 1 Then
{
If data2(CrossUp(C, MA(C, 10))) Then Buy("Buy", AtMarket);
If data2(CrossDown(C, MA(C, 10))) Then Sell("Sell", AtMarket);
}
If Time >= 94000 Then
{
If MarketPosition == -1 and EntryCount == 1 Then
{
If D2C >= D2C[BarsSinceEntry]+0.5 Then
{
Buy("손절매수", AtMarket);
}
}
}
If Time >= 90200 Then
{
If MarketPosition == 1 and EntryCount == 1 Then
{
If D2C[BarsSinceEntry] - lowest(D2L,barsSinceEntry+1) > 0.8
and crossup(data2(c),lowest(D2L,barsSinceEntry+1)+data2(atr(30))*3) Then
{
Buy("피라미딩매수");
}
}
}
If Marketposition == 1 then
{
if data2(c) <= D2C[BarsSinceEntry]-1.0 Then
exitlong("bloss");
if data2(c) >= D2C[BarsSinceEntry]+2.0 Then
exitlong("bprofit");
If highest(D2H,barsSinceEntry+1) - D2C[BarsSinceEntry] > ProfitLimit And
D2C <= highest(D2H,barsSinceEntry+1)-data2(atr(atrlen))*ts Then
exitlong("매수청산");
}
If Marketposition ==-1 then
{
if data2(c) >= D2C[BarsSinceEntry]+1.0 Then
ExitShort("sloss");
if data2(c) <= D2C[BarsSinceEntry]-2.0 Then
ExitShort("sprofit");
If D2C[BarsSinceEntry] - lowest(D2L,barsSinceEntry+1) > ProfitLimit And
D2C >= lowest(D2L,barsSinceEntry+1)+data2(atr(atrlen))*ts Then
exitshort("매도청산");
}
If Time >= 131000+TimeDelay Then Begin
ExitShort("DayEnd ExitShort");
ExitLong("DayEnd ExitLong");
End;
즐거운 하루되세요
> HI_ch****** 님이 쓴 글입니다.
> 제목 : 옵션매매
> 안녕하세요.
아래와 같은 선물전략을 옵션전략으로 변환부탁드립니다.
(ex. Close -> Data2(C) )
아룰러 기준선물차트가 50틱차트라면 옵션도 동일하게 50틱으로 설정하는
것이 좋나요? 선물신호가 나옴과 동시에 옵션에 신호를 발생시키려면
어떤식으로 설정해야 하나요?
그럼 수고하세요.
Input : EntryTime1(90700), EntryTime2(90400);
Var : cnt(0), EntryCount(0), DayGap(0), Signal("");
Var : atrlen(30), ts(3);
DayGap = ABS(DayOpen - DayClose(1));
EntryCount = 0;
For cnt = 0 to 20
{
If Sdate == EntryDate(cnt) Then EntryCount = EntryCount + 1;
}
If Time < EntryTime1 and EntryCount < 1 Then
{
If CrossUp(C, MA(C, 10)) Then Buy("Buy", AtMarket);
If CrossDown(C, MA(C, 10)) Then Sell("Sell", AtMarket);
}
If Time >= 94000 Then
{
If MarketPosition == -1 and EntryCount == 1 Then
{
If PositionProfit < -0.5 Then
{
Buy("손절매수", AtMarket);
}
}
}
If Time >= 90200 Then
{
If MarketPosition == 1 and EntryCount == 1 Then
{
If EntryPrice - lowest(low,barsSinceEntry+1) > 0.8 Then
{
Buy("피라미딩매수",Atstop,lowest(low,barsSinceEntry+1)+atr(30)*3);
}
}
}
SetStopLoss(1.0, PointStop);
SetstopProfittarget(2.0, Pointstop);
If Marketposition == 1 then
{
If highest(high,barsSinceEntry+1) - EntryPrice > ProfitLimit Then
exitlong("매수청산",Atstop,highest(high,barsSinceEntry+1)-atr(atrlen)*ts);
}
If Marketposition ==-1 then
{
If EntryPrice - lowest(low,barsSinceEntry+1) > ProfitLimit Then
exitshort("매도청산",Atstop,lowest(low,barsSinceEntry+1)+atr(atrlen)*ts);
}
If Time >= 131000+TimeDelay Then Begin
ExitShort("DayEnd ExitShort");
ExitLong("DayEnd ExitLong");
End;
다음글
이전글