커뮤니티
옵션수식부탁드립니다---------------
2012-01-29 16:53:13
354
글번호 47028
옵션매매용========================
Input:시작봉(3),허용치(10);
if dayindex+1 == 시작봉+1 Then{
if C >= dayopen Then
var65 = o-PriceScale*허용치;
Else
var65 = o+PriceScale*허용치;
}
plot1(var65);
if dayindex+1 == 시작봉+1 Then
var66 = O;
plot2(var66);
위식은 첨부차트에 두개의 선입니다
진입
장시작후 4째봉부터 10이평 상승하면서 위 라인 닿으면 매수
10이평 하락하면서 아래 라인 닿으면 매도
(시장에따라 var65, var66의 아래위가 바뀔될수 있으므로 차트상의 위, 아래를
말함)
손절
진입후 5틱손실이면 청산
추적
발생한이익이 2틱이상 3틱이하 이면 진입가에 청산
발생한이익이 4틱이상 6틱이하 이면 최고이익으로부터 이익틱의70%하락시 청산
발생한이익이 7틱이상 10틱이하 이면 최고이익으로부터 이익틱의60%하락시 청산
발생한이익이 11틱이상 15틱이하 이면 최고이익으로부터 이익틱의 50%하락시 청산
발생한이익이 16틱이상 25틱이하 이면 최고이익으로부터 이익틱의 45%하락시 청산
발생한이익이 26틱이상 40틱이하 이면 최고이익으로부터 이익틱의 40%하락시 청산
발생한이익이 41틱이상 60틱이하 이면 최고이익으로부터 이익틱의 35%하락시 청산
발생한이익이 61틱이상 90틱이하 이면 최고이익으로부터 이익틱의 30%하락시 청산
발생한이익이 91틱이상 110틱이하 이면 최고이익으로부터 이익틱의 25%하락시 청산
발생한이익이 111틱이상 150틱이하 이면 최고이익으로부터 이익틱의 20%하락시 청산
발생한이익이 151틱이상 이면 최고이익으로부터 이익틱의 10%하락시 청산
하루총 40만원 손실이면 모두청산후 진입금지
첨부참조
- 1. 옵션매매1.xls (0.15 MB)
답변 1
예스스탁 예스스탁 답변
2012-01-30 14:58:39
안녕하세요
예스스탁입니다.
Input:시작봉(3),허용치(10),당일손익(400000);
var : PLR(0),XCommission(0),XSlippage(0),OpenPL(0),dayPL(0),count(0);
#당일누적손익계산 시작
XCommission = ((C*ExitCommission)/100)*CurrentContracts; #%설정
XSlippage = (ExitSlippage)*CurrentContracts; #Pt설정
PLR = 0;
count = 0;
for var1 = 1 to 10{
if sdate == EntryDate(var1) Then{
count = count+1;
PLR = PLR+PositionProfit(var1);
}
}
if MarketPosition() == 0 Then{
OpenPL = 0;
dayPL = PLR;
}
Else{
OpenPL = (PositionProfit-(XCommission+XSlippage));
dayPL = PLR+OpenPL;
}
if dayindex+1 == 시작봉+1 Then{
if C >= dayopen Then
var65 = o-PriceScale*허용치;
Else
var65 = o+PriceScale*허용치;
}
if dayindex+1 == 시작봉+1 Then
var66 = O;
value1 = max(var65,var66);
value2 = min(var65,var66);
value3 = ma(c,10);
value6 = (당일손익/BigPointValue);
if dayindex+1 >= 시작봉+1 and dayPL < value6 Then{
if crossup(value3,value1) Then
buy();
if CrossDown(value3,value2) Then
sell();
}
SetStopLoss(PriceScale*5,PointStop);
if MarketPosition == 1 Then{
value4 = highest(H,BarsSinceEntry);
if value4 >= EntryPrice+PriceScale*2 and value4 < EntryPrice+PriceScale*3 Then
exitlong("bx1",AtStop,EntryPrice);
if value4 >= EntryPrice+PriceScale*4 and value4 < EntryPrice+PriceScale*6 Then
exitlong("bx2",AtStop,value4-(value4-EntryPrice)*0.70);
if value4 >= EntryPrice+PriceScale*7 and value4 < EntryPrice+PriceScale*10 Then
exitlong("bx3",AtStop,value4-(value4-EntryPrice)*0.60);
if value4 >= EntryPrice+PriceScale*11 and value4 < EntryPrice+PriceScale*15 Then
exitlong("bx4",AtStop,value4-(value4-EntryPrice)*0.50);
if value4 >= EntryPrice+PriceScale*16 and value4 < EntryPrice+PriceScale*25 Then
exitlong("bx5",AtStop,value4-(value4-EntryPrice)*0.45);
if value4 >= EntryPrice+PriceScale*26 and value4 < EntryPrice+PriceScale*40 Then
exitlong("bx6",AtStop,value4-(value4-EntryPrice)*0.40);
if value4 >= EntryPrice+PriceScale*41 and value4 < EntryPrice+PriceScale*60 Then
exitlong("bx7",AtStop,value4-(value4-EntryPrice)*0.35);
if value4 >= EntryPrice+PriceScale*61 and value4 < EntryPrice+PriceScale*90 Then
exitlong("bx8",AtStop,value4-(value4-EntryPrice)*0.30);
if value4 >= EntryPrice+PriceScale*91 and value4 < EntryPrice+PriceScale*110 Then
exitlong("bx9",AtStop,value4-(value4-EntryPrice)*0.25);
if value4 >= EntryPrice+PriceScale*111 and value4 < EntryPrice+PriceScale*150 Then
exitlong("bx10",AtStop,value4-(value4-EntryPrice)*0.20);
if value4 >= EntryPrice+PriceScale*151 Then
exitlong("bx11",AtStop,value4-(value4-EntryPrice)*0.1);
}
if MarketPosition == -1 Then{
value5 = Lowest(L,BarsSinceEntry);
if value5 <= EntryPrice-PriceScale*2 and value5 > EntryPrice-PriceScale*3 Then
ExitShort("sx1",AtStop,EntryPrice);
if value5 <= EntryPrice-PriceScale*4 and value5 > EntryPrice-PriceScale*6 Then
ExitShort("sx2",AtStop,value5+(entryprice-value5)*0.70);
if value5 <= EntryPrice-PriceScale*7 and value5 > EntryPrice-PriceScale*10 Then
ExitShort("sx3",AtStop,value5+(entryprice-value5)*0.60);
if value5 <= EntryPrice-PriceScale*11 and value5 > EntryPrice-PriceScale*15 Then
ExitShort("sx4",AtStop,value5+(entryprice-value5)*0.50);
if value5 <= EntryPrice-PriceScale*16 and value5 > EntryPrice-PriceScale*25 Then
ExitShort("sx5",AtStop,value5+(entryprice-value5)*0.45);
if value5 <= EntryPrice-PriceScale*26 and value5 > EntryPrice-PriceScale*40 Then
ExitShort("sx6",AtStop,value5+(entryprice-value5)*0.40);
if value5 <= EntryPrice-PriceScale*41 and value5 > EntryPrice-PriceScale*60 Then
ExitShort("sx7",AtStop,value5+(entryprice-value5)*0.35);
if value5 <= EntryPrice-PriceScale*61 and value5 > EntryPrice-PriceScale*90 Then
ExitShort("sx8",AtStop,value5+(entryprice-value5)*0.30);
if value5 <= EntryPrice-PriceScale*91 and value5 > EntryPrice-PriceScale*110 Then
ExitShort("sx9",AtStop,value5+(entryprice-value5)*0.25);
if value5 <= EntryPrice-PriceScale*111 and value5 > EntryPrice-PriceScale*150 Then
ExitShort("sx10",AtStop,value5+(entryprice-value5)*0.20);
if value5 <= EntryPrice-PriceScale*151 Then
ExitShort("sx11",AtStop,value5+(entryprice-value5)*0.1);
}
if MarketPosition == 1 Then{
ExitLong("bxx",AtStop,EntryPrice+(-(value6)-(PLR)));
}
if MarketPosition == -1 Then{
ExitShort("sxx",AtStop,EntryPrice+((value6)+(PLR)));
}
즐거운 하루되세요
> leekss1 님이 쓴 글입니다.
> 제목 : 옵션수식부탁드립니다---------------
> 옵션매매용========================
Input:시작봉(3),허용치(10);
if dayindex+1 == 시작봉+1 Then{
if C >= dayopen Then
var65 = o-PriceScale*허용치;
Else
var65 = o+PriceScale*허용치;
}
plot1(var65);
if dayindex+1 == 시작봉+1 Then
var66 = O;
plot2(var66);
위식은 첨부차트에 두개의 선입니다
진입
장시작후 4째봉부터 10이평 상승하면서 위 라인 닿으면 매수
10이평 하락하면서 아래 라인 닿으면 매도
(시장에따라 var65, var66의 아래위가 바뀔될수 있으므로 차트상의 위, 아래를
말함)
손절
진입후 5틱손실이면 청산
추적
발생한이익이 2틱이상 3틱이하 이면 진입가에 청산
발생한이익이 4틱이상 6틱이하 이면 최고이익으로부터 이익틱의70%하락시 청산
발생한이익이 7틱이상 10틱이하 이면 최고이익으로부터 이익틱의60%하락시 청산
발생한이익이 11틱이상 15틱이하 이면 최고이익으로부터 이익틱의 50%하락시 청산
발생한이익이 16틱이상 25틱이하 이면 최고이익으로부터 이익틱의 45%하락시 청산
발생한이익이 26틱이상 40틱이하 이면 최고이익으로부터 이익틱의 40%하락시 청산
발생한이익이 41틱이상 60틱이하 이면 최고이익으로부터 이익틱의 35%하락시 청산
발생한이익이 61틱이상 90틱이하 이면 최고이익으로부터 이익틱의 30%하락시 청산
발생한이익이 91틱이상 110틱이하 이면 최고이익으로부터 이익틱의 25%하락시 청산
발생한이익이 111틱이상 150틱이하 이면 최고이익으로부터 이익틱의 20%하락시 청산
발생한이익이 151틱이상 이면 최고이익으로부터 이익틱의 10%하락시 청산
하루총 40만원 손실이면 모두청산후 진입금지
첨부참조
다음글
이전글