커뮤니티
문의드립니다
2015-08-21 20:07:58
115
글번호 89758
안녕하세요.
아래 식에 다음조건을 추가하여 주세요.
조건 : 파라볼릭 변수 0.02, 0.2
파라볼릭 변수 0.03, 0.3
매수식에 c > para(0.02,0.2) and c > para(0.03,0.3)
매도식에 c < para(0.02,0.2) and c < para(0.03,0.3)
=> 제가 단순하게 매수,매도식에 추가하였더니 매매신호가 불규칙하여
부탁드립니다
감사합니다
===================================================================
input : af1(0.01),max1(0.1);
input : S1(10),P1(20);
var : para1(0),T1(0);
var : Bcond1(false);
var : Scond1(false);
para1 = sar(af1,max1);
if stime >= 170000 or stime < 160000 Then{
if crossup(C,para1) Then{
Bcond1 = false;
var1 = H;
T1 = 1;
}
if CrossDown(C,para1) Then{
Scond1 = false;
var1 = L;
T1 = -1;
}
if T1 == 1 and T1[1] == 1 and Bcond1 == false and H >= var1[1]+PriceScale*1 Then
Bcond1 = true;
if T1 == -1 and T1[1] == -1 and Scond1 == false and L <= var1[1]-PriceScale*1 Then
Scond1 = true;
if T1 == 1 and Bcond1 == false Then
buy("B1",AtStop,var1+PriceScale*1);
if T1 == -1 and Scond1 == false Then
sell("S1",AtStop,var1-PriceScale*1);
if MarketPosition == 1 then{
if CrossDown(c,para1) Then
exitlong("bx1");
}
if MarketPosition == -1 then{
if crossup(c,para1) Then
ExitShort("sx1");
}
}
if MarketPosition == 1 and highest(H,BarsSinceEntry) >= EntryPrice+PriceScale*P1 Then
exitlong("btr",AtStop,highest(H,BarsSinceEntry)-PriceScale*1);
if MarketPosition == -1 and Lowest(L,BarsSinceEntry) <= EntryPrice-PriceScale*P1 Then
exitshort("str",AtStop,Lowest(L,BarsSinceEntry)+PriceScale*1);
SetStopLoss(PriceScale*S1,PointStop);
if stime == 160000 or (stime > 160000 and stime[1] < 160000) Then{
exitlong("bexit");
ExitShort("sexit");
}
답변 1
예스스탁 예스스탁 답변
2015-08-24 09:16:40
안녕하세요
예스스탁입니다.
input : af1(0.01),max1(0.1);
input : af2(0.02),max2(0.2);
input : af3(0.03),max3(0.3);
input : S1(10),P1(20);
var : para1(0),T1(0);
var : Bcond1(false);
var : Scond1(false);
var : para2(0),para3(0);
para1 = sar(af1,max1);
para2 = sar(af2,max2);
para3 = sar(af3,max3);
if stime >= 170000 or stime < 160000 Then{
if crossup(C,para1) Then{
Bcond1 = false;
var1 = H;
T1 = 1;
}
if CrossDown(C,para1) Then{
Scond1 = false;
var1 = L;
T1 = -1;
}
if T1 == 1 and T1[1] == 1 and Bcond1 == false and H >= var1[1]+PriceScale*1 Then
Bcond1 = true;
if T1 == -1 and T1[1] == -1 and Scond1 == false and L <= var1[1]-PriceScale*1 Then
Scond1 = true;
if T1 == 1 and Bcond1 == false and C > para2 and C > para3 Then
buy("B1",AtStop,var1+PriceScale*1);
if T1 == -1 and Scond1 == false and C < para2 and C < para3 Then
sell("S1",AtStop,var1-PriceScale*1);
if MarketPosition == 1 then{
if CrossDown(c,para1) Then
exitlong("bx1");
}
if MarketPosition == -1 then{
if crossup(c,para1) Then
ExitShort("sx1");
}
}
if MarketPosition == 1 and highest(H,BarsSinceEntry) >= EntryPrice+PriceScale*P1 Then
exitlong("btr",AtStop,highest(H,BarsSinceEntry)-PriceScale*1);
if MarketPosition == -1 and Lowest(L,BarsSinceEntry) <= EntryPrice-PriceScale*P1 Then
exitshort("str",AtStop,Lowest(L,BarsSinceEntry)+PriceScale*1);
SetStopLoss(PriceScale*S1,PointStop);
if stime == 160000 or (stime > 160000 and stime[1] < 160000) Then{
exitlong("bexit");
ExitShort("sexit");
}
즐거운 하루되세요
> 베드로 님이 쓴 글입니다.
> 제목 : 문의드립니다
> 안녕하세요.
아래 식에 다음조건을 추가하여 주세요.
조건 : 파라볼릭 변수 0.02, 0.2
파라볼릭 변수 0.03, 0.3
매수식에 c > para(0.02,0.2) and c > para(0.03,0.3)
매도식에 c < para(0.02,0.2) and c < para(0.03,0.3)
=> 제가 단순하게 매수,매도식에 추가하였더니 매매신호가 불규칙하여
부탁드립니다
감사합니다
===================================================================
input : af1(0.01),max1(0.1);
input : S1(10),P1(20);
var : para1(0),T1(0);
var : Bcond1(false);
var : Scond1(false);
para1 = sar(af1,max1);
if stime >= 170000 or stime < 160000 Then{
if crossup(C,para1) Then{
Bcond1 = false;
var1 = H;
T1 = 1;
}
if CrossDown(C,para1) Then{
Scond1 = false;
var1 = L;
T1 = -1;
}
if T1 == 1 and T1[1] == 1 and Bcond1 == false and H >= var1[1]+PriceScale*1 Then
Bcond1 = true;
if T1 == -1 and T1[1] == -1 and Scond1 == false and L <= var1[1]-PriceScale*1 Then
Scond1 = true;
if T1 == 1 and Bcond1 == false Then
buy("B1",AtStop,var1+PriceScale*1);
if T1 == -1 and Scond1 == false Then
sell("S1",AtStop,var1-PriceScale*1);
if MarketPosition == 1 then{
if CrossDown(c,para1) Then
exitlong("bx1");
}
if MarketPosition == -1 then{
if crossup(c,para1) Then
ExitShort("sx1");
}
}
if MarketPosition == 1 and highest(H,BarsSinceEntry) >= EntryPrice+PriceScale*P1 Then
exitlong("btr",AtStop,highest(H,BarsSinceEntry)-PriceScale*1);
if MarketPosition == -1 and Lowest(L,BarsSinceEntry) <= EntryPrice-PriceScale*P1 Then
exitshort("str",AtStop,Lowest(L,BarsSinceEntry)+PriceScale*1);
SetStopLoss(PriceScale*S1,PointStop);
if stime == 160000 or (stime > 160000 and stime[1] < 160000) Then{
exitlong("bexit");
ExitShort("sexit");
}