커뮤니티
수식부탁드립니다---------------
2011-03-23 13:40:30
689
글번호 36822
Input : Period(0),maP(0),map6(0),N(0),Tr1(0),Tr2(0),진입(0),ADXP(00);
Input :Per1(00),X1(0),익절폭(0),절(0),손절(0),시작시간(103000);
Var : value(0);
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;
}
#당일누적손익계산 끝
var2 = adx(adxP);
value = ma(bids,period)-ma(asks,period);
#최근 X봉 동안 최고값이 최저값대비 per%이상 큼
Condition1 = highest(h,x1) >= lowest(L,x1)*(1+(Per1/100));
if var2 > var2[1] and stime >= 시작시간 and stime < 144500 and var2 >=10 and (dayPL < (c*익절폭) and dayPL > -(DayOpen*손절)) then
{
if value > value[1]+진입 and ma(C,map) >= ma(C,map)[1]+N and ma(C,9) >= ma(C,9)[1] and Condition1 Then
buy();
if value < value[1]-진입 and ma(C,map) <= ma(C,map)[1]-N and ma(C,9) <= ma(C,9)[1] and Condition1 Then
Sell();
}
SetStopLoss(PriceScale*절,PointStop);
#SetStopProfittarget(PriceScale*45,PointStop);
if crossup(daypl,c*익절폭) then{
exitlong("익절1");
ExitShort("익절2");
}
#당일 손실청산
if CrossDown(daypl,-(dayopen*손절)) then{
exitlong("손절1");
ExitShort("손절2");
}
//시간청산--------------------
var11 = int(date/100)-int(date/10000)*100; //월
var22 = date - int(date/100)*100; //일
var33 = DayOfWeek(date); //요일
if var11%3 == 0 and var22 >= 8 and var22 <= 14 and var33 == 4 then {
SetStopEndofday(144800); //만기날
}
else {
SetStopEndofday(150100); //평일
}
익절폭을 장 변동성에 따라 매일 바꿔주려고 하거든요
시초가에서 진입조건이 시작되는 10:30까지의 고저폭/2 를 익절폭으로 하려고합니다
예)고가:263.75 저가:260.40 고저폭:3.35 익절폭=3.35/2=1.675pt
답변 3
예스스탁 예스스탁 답변
2011-03-23 14:52:56
안녕하세요
예스스탁입니다.
Input : Period(0),maP(0),map6(0),N(0),Tr1(0),Tr2(0),진입(0),ADXP(00);
Input :Per1(00),X1(0),절(0),손절(0),시작시간(103000);
Var : value(0),익절폭(0);
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 stime == 시작시간 Then{
var1 = dayhigh;
var2 = DayLow;
익절폭 = var1-var2;
}
var2 = adx(adxP);
value = ma(bids,period)-ma(asks,period);
#최근 X봉 동안 최고값이 최저값대비 per%이상 큼
Condition1 = highest(h,x1) >= lowest(L,x1)*(1+(Per1/100));
if var2 > var2[1] and stime >= 시작시간 and stime < 144500 and var2 >=10 and (dayPL < (c*익절폭) and dayPL > -(DayOpen*손절)) then
{
if value > value[1]+진입 and ma(C,map) >= ma(C,map)[1]+N and ma(C,9) >= ma(C,9)[1] and Condition1 Then
buy();
if value < value[1]-진입 and ma(C,map) <= ma(C,map)[1]-N and ma(C,9) <= ma(C,9)[1] and Condition1 Then
Sell();
}
SetStopLoss(PriceScale*절,PointStop);
#SetStopProfittarget(PriceScale*45,PointStop);
if crossup(daypl,c*익절폭) then{
exitlong("익절1");
ExitShort("익절2");
}
#당일 손실청산
if CrossDown(daypl,-(dayopen*손절)) then{
exitlong("손절1");
ExitShort("손절2");
}
//시간청산--------------------
var11 = int(date/100)-int(date/10000)*100; //월
var22 = date - int(date/100)*100; //일
var33 = DayOfWeek(date); //요일
if var11%3 == 0 and var22 >= 8 and var22 <= 14 and var33 == 4 then {
SetStopEndofday(144800); //만기날
}
else {
SetStopEndofday(150100); //평일
}
즐거운 하루되세요
> leekss1 님이 쓴 글입니다.
> 제목 : 수식부탁드립니다---------------
> Input : Period(0),maP(0),map6(0),N(0),Tr1(0),Tr2(0),진입(0),ADXP(00);
Input :Per1(00),X1(0),익절폭(0),절(0),손절(0),시작시간(103000);
Var : value(0);
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;
}
#당일누적손익계산 끝
var2 = adx(adxP);
value = ma(bids,period)-ma(asks,period);
#최근 X봉 동안 최고값이 최저값대비 per%이상 큼
Condition1 = highest(h,x1) >= lowest(L,x1)*(1+(Per1/100));
if var2 > var2[1] and stime >= 시작시간 and stime < 144500 and var2 >=10 and (dayPL < (c*익절폭) and dayPL > -(DayOpen*손절)) then
{
if value > value[1]+진입 and ma(C,map) >= ma(C,map)[1]+N and ma(C,9) >= ma(C,9)[1] and Condition1 Then
buy();
if value < value[1]-진입 and ma(C,map) <= ma(C,map)[1]-N and ma(C,9) <= ma(C,9)[1] and Condition1 Then
Sell();
}
SetStopLoss(PriceScale*절,PointStop);
#SetStopProfittarget(PriceScale*45,PointStop);
if crossup(daypl,c*익절폭) then{
exitlong("익절1");
ExitShort("익절2");
}
#당일 손실청산
if CrossDown(daypl,-(dayopen*손절)) then{
exitlong("손절1");
ExitShort("손절2");
}
//시간청산--------------------
var11 = int(date/100)-int(date/10000)*100; //월
var22 = date - int(date/100)*100; //일
var33 = DayOfWeek(date); //요일
if var11%3 == 0 and var22 >= 8 and var22 <= 14 and var33 == 4 then {
SetStopEndofday(144800); //만기날
}
else {
SetStopEndofday(150100); //평일
}
익절폭을 장 변동성에 따라 매일 바꿔주려고 하거든요
시초가에서 진입조건이 시작되는 10:30까지의 고저폭/2 를 익절폭으로 하려고합니다
예)고가:263.75 저가:260.40 고저폭:3.35 익절폭=3.35/2=1.675pt
leekss1
2011-03-23 16:03:02
이전 식과다른건 익절폭 조절밖에 없는데
이상하게 3일이나 진입안하는날이 있네요 물론 새로지정한 var1,2는 var3,4로 바꿨습니다 아래식조금 바궜습니다(c*익절폭)->(익절폭)
Input : Period(0),maP(0),map6(0),N(0),Tr1(0),Tr2(0),진입(0),ADXP(00);
Input :Per1(00),X1(0),절(0),손절(0),시작시간(103000);
Var : value(0),익절폭(0);
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 stime == 시작시간 Then{
var3 = dayhigh;
var4 = DayLow;
익절폭 = var3-var4;
}
var2 = adx(adxP);
value = ma(bids,period)-ma(asks,period);
#최근 X봉 동안 최고값이 최저값대비 per%이상 큼
Condition1 = highest(h,x1) >= lowest(L,x1)*(1+(Per1/100));
if var2 > var2[1] and stime >= 시작시간 and stime < 144500 and var2 >=10 and (dayPL < (익절폭) and dayPL > -(DayOpen*손절)) then
{
if value > value[1]+진입 and ma(C,map) >= ma(C,map)[1]+N and ma(C,9) >= ma(C,9)[1] and Condition1 Then
buy();
if value < value[1]-진입 and ma(C,map) <= ma(C,map)[1]-N and ma(C,9) <= ma(C,9)[1] and Condition1 Then
Sell();
}
SetStopLoss(PriceScale*절,PointStop);
#SetStopProfittarget(PriceScale*45,PointStop);
if crossup(daypl,익절폭) then{
exitlong("익절1");
ExitShort("익절2");
}
#당일 손실청산
if CrossDown(daypl,-(dayopen*손절)) then{
exitlong("손절1");
ExitShort("손절2");
}
//시간청산--------------------
var11 = int(date/100)-int(date/10000)*100; //월
var22 = date - int(date/100)*100; //일
var33 = DayOfWeek(date); //요일
if var11%3 == 0 and var22 >= 8 and var22 <= 14 and var33 == 4 then {
SetStopEndofday(144800); //만기날
}
else {
SetStopEndofday(150100); //평일
}
예스스탁 예스스탁 답변
2011-03-23 16:48:57
안녕하세요
예스스탁입니다.
전화로 답변드린데로 메세지로그를 이용해서
수식에서 계산된 값을 확인할 수 있습니다.
아래의 링크를 참고하시기 바랍니다.
https://www.yesstock.com/YesTrader/YesLanguage/YesLanguage_help/4_2.htm
즐거운 하루되세요
> leekss1 님이 쓴 글입니다.
> 제목 : Re : Re : 수식부탁드립니다---------------
> 이전 식과다른건 익절폭 조절밖에 없는데
이상하게 3일이나 진입안하는날이 있네요 물론 새로지정한 var1,2는 var3,4로 바꿨습니다 아래식조금 바궜습니다(c*익절폭)->(익절폭)
Input : Period(0),maP(0),map6(0),N(0),Tr1(0),Tr2(0),진입(0),ADXP(00);
Input :Per1(00),X1(0),절(0),손절(0),시작시간(103000);
Var : value(0),익절폭(0);
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 stime == 시작시간 Then{
var3 = dayhigh;
var4 = DayLow;
익절폭 = var3-var4;
}
var2 = adx(adxP);
value = ma(bids,period)-ma(asks,period);
#최근 X봉 동안 최고값이 최저값대비 per%이상 큼
Condition1 = highest(h,x1) >= lowest(L,x1)*(1+(Per1/100));
if var2 > var2[1] and stime >= 시작시간 and stime < 144500 and var2 >=10 and (dayPL < (익절폭) and dayPL > -(DayOpen*손절)) then
{
if value > value[1]+진입 and ma(C,map) >= ma(C,map)[1]+N and ma(C,9) >= ma(C,9)[1] and Condition1 Then
buy();
if value < value[1]-진입 and ma(C,map) <= ma(C,map)[1]-N and ma(C,9) <= ma(C,9)[1] and Condition1 Then
Sell();
}
SetStopLoss(PriceScale*절,PointStop);
#SetStopProfittarget(PriceScale*45,PointStop);
if crossup(daypl,익절폭) then{
exitlong("익절1");
ExitShort("익절2");
}
#당일 손실청산
if CrossDown(daypl,-(dayopen*손절)) then{
exitlong("손절1");
ExitShort("손절2");
}
//시간청산--------------------
var11 = int(date/100)-int(date/10000)*100; //월
var22 = date - int(date/100)*100; //일
var33 = DayOfWeek(date); //요일
if var11%3 == 0 and var22 >= 8 and var22 <= 14 and var33 == 4 then {
SetStopEndofday(144800); //만기날
}
else {
SetStopEndofday(150100); //평일
}
다음글
이전글