커뮤니티
수식부탁드립니다
2011-03-21 15:22:39
848
글번호 36741
Input : Period(0),maP(0),map6(0),N(0),Tr1(0),Tr2(0),진입(0),ADXP(0),Per1(0),X1(0),익절폭(0);
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 stime >= 093000 and stime < 144500 and var2 >=10 and dayPL < (c*익절폭) 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*15,PointStop);
#SetStopProfittarget(PriceScale*45,PointStop);
if crossup(daypl,c*익절폭) then{
exitlong("익절1");
ExitShort("익절2");
}
if Condition1 == true Then{
if MarketPosition == 1 Then{
ExitLong("15b절",AtStop,EntryPrice-PriceScale*15);
ExitLong("bx5",AtLimit,EntryPrice+PriceScale*19);
}
if MarketPosition == -1 Then{
ExitShort("15s절",AtStop,EntryPrice+PriceScale*15);
ExitShort("sx5",AtLimit,EntryPrice-PriceScale*19);
}
}
if Condition1 == false Then{
if MarketPosition == 1 Then{
if Highest(H,BarsSinceEntry) < EntryPrice+1 Then
ExitLong("bx1",AtStop,Highest(H,BarsSinceEntry)-tr1);
Else
ExitLong("bx2",AtStop,Highest(H,BarsSinceEntry)-tr2);
}
if MarketPosition == -1 Then{
if Lowest(L,BarsSinceEntry) > EntryPrice-1 Then
ExitShort("sx1",AtStop,Lowest(L,BarsSinceEntry)+tr1);
Else
ExitShort("sx2",AtStop,Lowest(L,BarsSinceEntry)+tr2);
}
}
#단기이평청산----------------------
#if MarketPosition == 1 and ma(C,5) < ma(C,5)[1]-0.25 Then
# ExitLong();
#if MarketPosition == -1 and ma(C,5) > ma(C,5)[1]+0.25 Then
# ExitShort();
//시간청산--------------------
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); //평일
}
죄송합니다 질문이 부족했었네요
당일중 오늘시가 의 1%(오늘시가가265.00면 시가의 1%=2.65pt)손실나면 당일매매 금지하게해주세요
답변 5
예스스탁 예스스탁 답변
2011-03-21 16:34:50
안녕하세요
예스스탁입니다.
Input : Period(0),maP(0),map6(0),N(0),Tr1(0),Tr2(0),진입(0),ADXP(0),Per1(0),X1(0),익절폭(0);
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 stime >= 093000 and stime < 144500 and var2 >=10 and dayPL < (c*익절폭) and dayPL > DayOpen*0.01 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*15,PointStop);
#SetStopProfittarget(PriceScale*45,PointStop);
if crossup(daypl,c*익절폭) then{
exitlong("익절1");
ExitShort("익절2");
}
if Condition1 == true Then{
if MarketPosition == 1 Then{
ExitLong("15b절",AtStop,EntryPrice-PriceScale*15);
ExitLong("bx5",AtLimit,EntryPrice+PriceScale*19);
}
if MarketPosition == -1 Then{
ExitShort("15s절",AtStop,EntryPrice+PriceScale*15);
ExitShort("sx5",AtLimit,EntryPrice-PriceScale*19);
}
}
if Condition1 == false Then{
if MarketPosition == 1 Then{
if Highest(H,BarsSinceEntry) < EntryPrice+1 Then
ExitLong("bx1",AtStop,Highest(H,BarsSinceEntry)-tr1);
Else
ExitLong("bx2",AtStop,Highest(H,BarsSinceEntry)-tr2);
}
if MarketPosition == -1 Then{
if Lowest(L,BarsSinceEntry) > EntryPrice-1 Then
ExitShort("sx1",AtStop,Lowest(L,BarsSinceEntry)+tr1);
Else
ExitShort("sx2",AtStop,Lowest(L,BarsSinceEntry)+tr2);
}
}
#단기이평청산----------------------
#if MarketPosition == 1 and ma(C,5) < ma(C,5)[1]-0.25 Then
# ExitLong();
#if MarketPosition == -1 and ma(C,5) > ma(C,5)[1]+0.25 Then
# ExitShort();
//시간청산--------------------
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); //평일
}
#당일 손실청산
if crossup(daypl,dayopen*0.01) then{
exitlong("손절1");
ExitShort("손절2");
}
즐거운 하루되세요
> leekss1 님이 쓴 글입니다.
> 제목 : 수식부탁드립니다
> Input : Period(0),maP(0),map6(0),N(0),Tr1(0),Tr2(0),진입(0),ADXP(0),Per1(0),X1(0),익절폭(0);
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 stime >= 093000 and stime < 144500 and var2 >=10 and dayPL < (c*익절폭) 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*15,PointStop);
#SetStopProfittarget(PriceScale*45,PointStop);
if crossup(daypl,c*익절폭) then{
exitlong("익절1");
ExitShort("익절2");
}
if Condition1 == true Then{
if MarketPosition == 1 Then{
ExitLong("15b절",AtStop,EntryPrice-PriceScale*15);
ExitLong("bx5",AtLimit,EntryPrice+PriceScale*19);
}
if MarketPosition == -1 Then{
ExitShort("15s절",AtStop,EntryPrice+PriceScale*15);
ExitShort("sx5",AtLimit,EntryPrice-PriceScale*19);
}
}
if Condition1 == false Then{
if MarketPosition == 1 Then{
if Highest(H,BarsSinceEntry) < EntryPrice+1 Then
ExitLong("bx1",AtStop,Highest(H,BarsSinceEntry)-tr1);
Else
ExitLong("bx2",AtStop,Highest(H,BarsSinceEntry)-tr2);
}
if MarketPosition == -1 Then{
if Lowest(L,BarsSinceEntry) > EntryPrice-1 Then
ExitShort("sx1",AtStop,Lowest(L,BarsSinceEntry)+tr1);
Else
ExitShort("sx2",AtStop,Lowest(L,BarsSinceEntry)+tr2);
}
}
#단기이평청산----------------------
#if MarketPosition == 1 and ma(C,5) < ma(C,5)[1]-0.25 Then
# ExitLong();
#if MarketPosition == -1 and ma(C,5) > ma(C,5)[1]+0.25 Then
# ExitShort();
//시간청산--------------------
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); //평일
}
죄송합니다 질문이 부족했었네요
당일중 오늘시가 의 1%(오늘시가가265.00면 시가의 1%=2.65pt)손실나면 당일매매 금지하게해주세요
leekss1
2011-03-21 17:14:58
변수도 제데로 했는데 진입을안하네요
> 예스스탁 님이 쓴 글입니다.
> 제목 : Re : 수식부탁드립니다
> 안녕하세요
예스스탁입니다.
Input : Period(0),maP(0),map6(0),N(0),Tr1(0),Tr2(0),진입(0),ADXP(0),Per1(0),X1(0),익절폭(0);
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 stime >= 093000 and stime < 144500 and var2 >=10 and dayPL < (c*익절폭) and dayPL > DayOpen*0.01 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*15,PointStop);
#SetStopProfittarget(PriceScale*45,PointStop);
if crossup(daypl,c*익절폭) then{
exitlong("익절1");
ExitShort("익절2");
}
if Condition1 == true Then{
if MarketPosition == 1 Then{
ExitLong("15b절",AtStop,EntryPrice-PriceScale*15);
ExitLong("bx5",AtLimit,EntryPrice+PriceScale*19);
}
if MarketPosition == -1 Then{
ExitShort("15s절",AtStop,EntryPrice+PriceScale*15);
ExitShort("sx5",AtLimit,EntryPrice-PriceScale*19);
}
}
if Condition1 == false Then{
if MarketPosition == 1 Then{
if Highest(H,BarsSinceEntry) < EntryPrice+1 Then
ExitLong("bx1",AtStop,Highest(H,BarsSinceEntry)-tr1);
Else
ExitLong("bx2",AtStop,Highest(H,BarsSinceEntry)-tr2);
}
if MarketPosition == -1 Then{
if Lowest(L,BarsSinceEntry) > EntryPrice-1 Then
ExitShort("sx1",AtStop,Lowest(L,BarsSinceEntry)+tr1);
Else
ExitShort("sx2",AtStop,Lowest(L,BarsSinceEntry)+tr2);
}
}
#단기이평청산----------------------
#if MarketPosition == 1 and ma(C,5) < ma(C,5)[1]-0.25 Then
# ExitLong();
#if MarketPosition == -1 and ma(C,5) > ma(C,5)[1]+0.25 Then
# ExitShort();
//시간청산--------------------
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); //평일
}
#당일 손실청산
if crossup(daypl,dayopen*0.01) then{
exitlong("손절1");
ExitShort("손절2");
}
즐거운 하루되세요
> leekss1 님이 쓴 글입니다.
> 제목 : 수식부탁드립니다
> Input : Period(0),maP(0),map6(0),N(0),Tr1(0),Tr2(0),진입(0),ADXP(0),Per1(0),X1(0),익절폭(0);
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 stime >= 093000 and stime < 144500 and var2 >=10 and dayPL < (c*익절폭) 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*15,PointStop);
#SetStopProfittarget(PriceScale*45,PointStop);
if crossup(daypl,c*익절폭) then{
exitlong("익절1");
ExitShort("익절2");
}
if Condition1 == true Then{
if MarketPosition == 1 Then{
ExitLong("15b절",AtStop,EntryPrice-PriceScale*15);
ExitLong("bx5",AtLimit,EntryPrice+PriceScale*19);
}
if MarketPosition == -1 Then{
ExitShort("15s절",AtStop,EntryPrice+PriceScale*15);
ExitShort("sx5",AtLimit,EntryPrice-PriceScale*19);
}
}
if Condition1 == false Then{
if MarketPosition == 1 Then{
if Highest(H,BarsSinceEntry) < EntryPrice+1 Then
ExitLong("bx1",AtStop,Highest(H,BarsSinceEntry)-tr1);
Else
ExitLong("bx2",AtStop,Highest(H,BarsSinceEntry)-tr2);
}
if MarketPosition == -1 Then{
if Lowest(L,BarsSinceEntry) > EntryPrice-1 Then
ExitShort("sx1",AtStop,Lowest(L,BarsSinceEntry)+tr1);
Else
ExitShort("sx2",AtStop,Lowest(L,BarsSinceEntry)+tr2);
}
}
#단기이평청산----------------------
#if MarketPosition == 1 and ma(C,5) < ma(C,5)[1]-0.25 Then
# ExitLong();
#if MarketPosition == -1 and ma(C,5) > ma(C,5)[1]+0.25 Then
# ExitShort();
//시간청산--------------------
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); //평일
}
죄송합니다 질문이 부족했었네요
당일중 오늘시가 의 1%(오늘시가가265.00면 시가의 1%=2.65pt)손실나면 당일매매 금지하게해주세요
예스스탁 예스스탁 답변
2011-03-21 17:54:09
안녕하세요
예스스탁입니다.
죄송합니다.
수식에 잘못처리된 부분이 있어 수정했습니다.
Input : Period(0),maP(0),map6(0),N(0),Tr1(0),Tr2(0),진입(0),ADXP(0),Per1(0),X1(0),익절폭(0);
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 stime >= 093000 and stime < 144500 and var2 >=10 and (dayPL < (c*익절폭) and dayPL > -(DayOpen*0.01)) 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*15,PointStop);
#SetStopProfittarget(PriceScale*45,PointStop);
if crossup(daypl,c*익절폭) then{
exitlong("익절1");
ExitShort("익절2");
}
if Condition1 == true Then{
if MarketPosition == 1 Then{
ExitLong("15b절",AtStop,EntryPrice-PriceScale*15);
ExitLong("bx5",AtLimit,EntryPrice+PriceScale*19);
}
if MarketPosition == -1 Then{
ExitShort("15s절",AtStop,EntryPrice+PriceScale*15);
ExitShort("sx5",AtLimit,EntryPrice-PriceScale*19);
}
}
if Condition1 == false Then{
if MarketPosition == 1 Then{
if Highest(H,BarsSinceEntry) < EntryPrice+1 Then
ExitLong("bx1",AtStop,Highest(H,BarsSinceEntry)-tr1);
Else
ExitLong("bx2",AtStop,Highest(H,BarsSinceEntry)-tr2);
}
if MarketPosition == -1 Then{
if Lowest(L,BarsSinceEntry) > EntryPrice-1 Then
ExitShort("sx1",AtStop,Lowest(L,BarsSinceEntry)+tr1);
Else
ExitShort("sx2",AtStop,Lowest(L,BarsSinceEntry)+tr2);
}
}
#단기이평청산----------------------
#if MarketPosition == 1 and ma(C,5) < ma(C,5)[1]-0.25 Then
# ExitLong();
#if MarketPosition == -1 and ma(C,5) > ma(C,5)[1]+0.25 Then
# ExitShort();
//시간청산--------------------
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); //평일
}
#당일 손실청산
if CrossDown(daypl,-(dayopen*0.01)) then{
exitlong("손절1");
ExitShort("손절2");
}
즐거운 하루되세요
> leekss1 님이 쓴 글입니다.
> 제목 : 진입을안하는데요
> 변수도 제데로 했는데 진입을안하네요
> 예스스탁 님이 쓴 글입니다.
> 제목 : Re : 수식부탁드립니다
> 안녕하세요
예스스탁입니다.
Input : Period(0),maP(0),map6(0),N(0),Tr1(0),Tr2(0),진입(0),ADXP(0),Per1(0),X1(0),익절폭(0);
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 stime >= 093000 and stime < 144500 and var2 >=10 and dayPL < (c*익절폭) and dayPL > DayOpen*0.01 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*15,PointStop);
#SetStopProfittarget(PriceScale*45,PointStop);
if crossup(daypl,c*익절폭) then{
exitlong("익절1");
ExitShort("익절2");
}
if Condition1 == true Then{
if MarketPosition == 1 Then{
ExitLong("15b절",AtStop,EntryPrice-PriceScale*15);
ExitLong("bx5",AtLimit,EntryPrice+PriceScale*19);
}
if MarketPosition == -1 Then{
ExitShort("15s절",AtStop,EntryPrice+PriceScale*15);
ExitShort("sx5",AtLimit,EntryPrice-PriceScale*19);
}
}
if Condition1 == false Then{
if MarketPosition == 1 Then{
if Highest(H,BarsSinceEntry) < EntryPrice+1 Then
ExitLong("bx1",AtStop,Highest(H,BarsSinceEntry)-tr1);
Else
ExitLong("bx2",AtStop,Highest(H,BarsSinceEntry)-tr2);
}
if MarketPosition == -1 Then{
if Lowest(L,BarsSinceEntry) > EntryPrice-1 Then
ExitShort("sx1",AtStop,Lowest(L,BarsSinceEntry)+tr1);
Else
ExitShort("sx2",AtStop,Lowest(L,BarsSinceEntry)+tr2);
}
}
#단기이평청산----------------------
#if MarketPosition == 1 and ma(C,5) < ma(C,5)[1]-0.25 Then
# ExitLong();
#if MarketPosition == -1 and ma(C,5) > ma(C,5)[1]+0.25 Then
# ExitShort();
//시간청산--------------------
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); //평일
}
#당일 손실청산
if crossup(daypl,dayopen*0.01) then{
exitlong("손절1");
ExitShort("손절2");
}
즐거운 하루되세요
> leekss1 님이 쓴 글입니다.
> 제목 : 수식부탁드립니다
> Input : Period(0),maP(0),map6(0),N(0),Tr1(0),Tr2(0),진입(0),ADXP(0),Per1(0),X1(0),익절폭(0);
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 stime >= 093000 and stime < 144500 and var2 >=10 and dayPL < (c*익절폭) 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*15,PointStop);
#SetStopProfittarget(PriceScale*45,PointStop);
if crossup(daypl,c*익절폭) then{
exitlong("익절1");
ExitShort("익절2");
}
if Condition1 == true Then{
if MarketPosition == 1 Then{
ExitLong("15b절",AtStop,EntryPrice-PriceScale*15);
ExitLong("bx5",AtLimit,EntryPrice+PriceScale*19);
}
if MarketPosition == -1 Then{
ExitShort("15s절",AtStop,EntryPrice+PriceScale*15);
ExitShort("sx5",AtLimit,EntryPrice-PriceScale*19);
}
}
if Condition1 == false Then{
if MarketPosition == 1 Then{
if Highest(H,BarsSinceEntry) < EntryPrice+1 Then
ExitLong("bx1",AtStop,Highest(H,BarsSinceEntry)-tr1);
Else
ExitLong("bx2",AtStop,Highest(H,BarsSinceEntry)-tr2);
}
if MarketPosition == -1 Then{
if Lowest(L,BarsSinceEntry) > EntryPrice-1 Then
ExitShort("sx1",AtStop,Lowest(L,BarsSinceEntry)+tr1);
Else
ExitShort("sx2",AtStop,Lowest(L,BarsSinceEntry)+tr2);
}
}
#단기이평청산----------------------
#if MarketPosition == 1 and ma(C,5) < ma(C,5)[1]-0.25 Then
# ExitLong();
#if MarketPosition == -1 and ma(C,5) > ma(C,5)[1]+0.25 Then
# ExitShort();
//시간청산--------------------
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); //평일
}
죄송합니다 질문이 부족했었네요
당일중 오늘시가 의 1%(오늘시가가265.00면 시가의 1%=2.65pt)손실나면 당일매매 금지하게해주세요
leekss1
2011-03-21 17:33:37
진입은하는데 (DayOpen*0.001)로바꿔도 6포인트이상 손실날때가있네요
> 예스스탁 님이 쓴 글입니다.
> 제목 : Re : 진입을안하는데요
> 안녕하세요
예스스탁입니다.
죄송합니다.
수식에 잘못처리된 부분이 있어 수정했습니다.
Input : Period(0),maP(0),map6(0),N(0),Tr1(0),Tr2(0),진입(0),ADXP(0),Per1(0),X1(0),익절폭(0);
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 stime >= 093000 and stime < 144500 and var2 >=10 /*and (dayPL < (c*익절폭) or dayPL > -(DayOpen*0.01))*/ 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*15,PointStop);
#SetStopProfittarget(PriceScale*45,PointStop);
if crossup(daypl,c*익절폭) then{
exitlong("익절1");
ExitShort("익절2");
}
if Condition1 == true Then{
if MarketPosition == 1 Then{
ExitLong("15b절",AtStop,EntryPrice-PriceScale*15);
ExitLong("bx5",AtLimit,EntryPrice+PriceScale*19);
}
if MarketPosition == -1 Then{
ExitShort("15s절",AtStop,EntryPrice+PriceScale*15);
ExitShort("sx5",AtLimit,EntryPrice-PriceScale*19);
}
}
if Condition1 == false Then{
if MarketPosition == 1 Then{
if Highest(H,BarsSinceEntry) < EntryPrice+1 Then
ExitLong("bx1",AtStop,Highest(H,BarsSinceEntry)-tr1);
Else
ExitLong("bx2",AtStop,Highest(H,BarsSinceEntry)-tr2);
}
if MarketPosition == -1 Then{
if Lowest(L,BarsSinceEntry) > EntryPrice-1 Then
ExitShort("sx1",AtStop,Lowest(L,BarsSinceEntry)+tr1);
Else
ExitShort("sx2",AtStop,Lowest(L,BarsSinceEntry)+tr2);
}
}
#단기이평청산----------------------
#if MarketPosition == 1 and ma(C,5) < ma(C,5)[1]-0.25 Then
# ExitLong();
#if MarketPosition == -1 and ma(C,5) > ma(C,5)[1]+0.25 Then
# ExitShort();
//시간청산--------------------
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); //평일
}
#당일 손실청산
if CrossDown(daypl,-(dayopen*0.01)) then{
exitlong("손절1");
ExitShort("손절2");
}
즐거운 하루되세요
> leekss1 님이 쓴 글입니다.
> 제목 : 진입을안하는데요
> 변수도 제데로 했는데 진입을안하네요
> 예스스탁 님이 쓴 글입니다.
> 제목 : Re : 수식부탁드립니다
> 안녕하세요
예스스탁입니다.
Input : Period(0),maP(0),map6(0),N(0),Tr1(0),Tr2(0),진입(0),ADXP(0),Per1(0),X1(0),익절폭(0);
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 stime >= 093000 and stime < 144500 and var2 >=10 and dayPL < (c*익절폭) and dayPL > DayOpen*0.01 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*15,PointStop);
#SetStopProfittarget(PriceScale*45,PointStop);
if crossup(daypl,c*익절폭) then{
exitlong("익절1");
ExitShort("익절2");
}
if Condition1 == true Then{
if MarketPosition == 1 Then{
ExitLong("15b절",AtStop,EntryPrice-PriceScale*15);
ExitLong("bx5",AtLimit,EntryPrice+PriceScale*19);
}
if MarketPosition == -1 Then{
ExitShort("15s절",AtStop,EntryPrice+PriceScale*15);
ExitShort("sx5",AtLimit,EntryPrice-PriceScale*19);
}
}
if Condition1 == false Then{
if MarketPosition == 1 Then{
if Highest(H,BarsSinceEntry) < EntryPrice+1 Then
ExitLong("bx1",AtStop,Highest(H,BarsSinceEntry)-tr1);
Else
ExitLong("bx2",AtStop,Highest(H,BarsSinceEntry)-tr2);
}
if MarketPosition == -1 Then{
if Lowest(L,BarsSinceEntry) > EntryPrice-1 Then
ExitShort("sx1",AtStop,Lowest(L,BarsSinceEntry)+tr1);
Else
ExitShort("sx2",AtStop,Lowest(L,BarsSinceEntry)+tr2);
}
}
#단기이평청산----------------------
#if MarketPosition == 1 and ma(C,5) < ma(C,5)[1]-0.25 Then
# ExitLong();
#if MarketPosition == -1 and ma(C,5) > ma(C,5)[1]+0.25 Then
# ExitShort();
//시간청산--------------------
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); //평일
}
#당일 손실청산
if crossup(daypl,dayopen*0.01) then{
exitlong("손절1");
ExitShort("손절2");
}
즐거운 하루되세요
> leekss1 님이 쓴 글입니다.
> 제목 : 수식부탁드립니다
> Input : Period(0),maP(0),map6(0),N(0),Tr1(0),Tr2(0),진입(0),ADXP(0),Per1(0),X1(0),익절폭(0);
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 stime >= 093000 and stime < 144500 and var2 >=10 and dayPL < (c*익절폭) 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*15,PointStop);
#SetStopProfittarget(PriceScale*45,PointStop);
if crossup(daypl,c*익절폭) then{
exitlong("익절1");
ExitShort("익절2");
}
if Condition1 == true Then{
if MarketPosition == 1 Then{
ExitLong("15b절",AtStop,EntryPrice-PriceScale*15);
ExitLong("bx5",AtLimit,EntryPrice+PriceScale*19);
}
if MarketPosition == -1 Then{
ExitShort("15s절",AtStop,EntryPrice+PriceScale*15);
ExitShort("sx5",AtLimit,EntryPrice-PriceScale*19);
}
}
if Condition1 == false Then{
if MarketPosition == 1 Then{
if Highest(H,BarsSinceEntry) < EntryPrice+1 Then
ExitLong("bx1",AtStop,Highest(H,BarsSinceEntry)-tr1);
Else
ExitLong("bx2",AtStop,Highest(H,BarsSinceEntry)-tr2);
}
if MarketPosition == -1 Then{
if Lowest(L,BarsSinceEntry) > EntryPrice-1 Then
ExitShort("sx1",AtStop,Lowest(L,BarsSinceEntry)+tr1);
Else
ExitShort("sx2",AtStop,Lowest(L,BarsSinceEntry)+tr2);
}
}
#단기이평청산----------------------
#if MarketPosition == 1 and ma(C,5) < ma(C,5)[1]-0.25 Then
# ExitLong();
#if MarketPosition == -1 and ma(C,5) > ma(C,5)[1]+0.25 Then
# ExitShort();
//시간청산--------------------
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); //평일
}
죄송합니다 질문이 부족했었네요
당일중 오늘시가 의 1%(오늘시가가265.00면 시가의 1%=2.65pt)손실나면 당일매매 금지하게해주세요
예스스탁 예스스탁 답변
2011-03-21 17:56:14
Input : Period(0),maP(0),map6(0),N(0),Tr1(0),Tr2(0),진입(0),ADXP(0),Per1(0),X1(0),익절폭(0);
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 stime >= 093000 and stime < 144500 and var2 >=10 and (dayPL < (c*익절폭) and dayPL > -(DayOpen*0.01)) 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*15,PointStop);
#SetStopProfittarget(PriceScale*45,PointStop);
if crossup(daypl,c*익절폭) then{
exitlong("익절1");
ExitShort("익절2");
}
if Condition1 == true Then{
if MarketPosition == 1 Then{
ExitLong("15b절",AtStop,EntryPrice-PriceScale*15);
ExitLong("bx5",AtLimit,EntryPrice+PriceScale*19);
}
if MarketPosition == -1 Then{
ExitShort("15s절",AtStop,EntryPrice+PriceScale*15);
ExitShort("sx5",AtLimit,EntryPrice-PriceScale*19);
}
}
if Condition1 == false Then{
if MarketPosition == 1 Then{
if Highest(H,BarsSinceEntry) < EntryPrice+1 Then
ExitLong("bx1",AtStop,Highest(H,BarsSinceEntry)-tr1);
Else
ExitLong("bx2",AtStop,Highest(H,BarsSinceEntry)-tr2);
}
if MarketPosition == -1 Then{
if Lowest(L,BarsSinceEntry) > EntryPrice-1 Then
ExitShort("sx1",AtStop,Lowest(L,BarsSinceEntry)+tr1);
Else
ExitShort("sx2",AtStop,Lowest(L,BarsSinceEntry)+tr2);
}
}
#단기이평청산----------------------
#if MarketPosition == 1 and ma(C,5) < ma(C,5)[1]-0.25 Then
# ExitLong();
#if MarketPosition == -1 and ma(C,5) > ma(C,5)[1]+0.25 Then
# ExitShort();
//시간청산--------------------
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); //평일
}
#당일 손실청산
if CrossDown(daypl,-(dayopen*0.01)) then{
exitlong("손절1");
ExitShort("손절2");
}