커뮤니티
부탁합ㄴ니다
2014-03-31 12:20:36
130
글번호 73949
1번수식
var1 = BollBandUp(20,2);
var2 = BollBandDown(20,2);
if C >= O Then{
if C > var1+0.5 then
ExitShort();
Else
buy();
}
if C <= O Then{
if C < var2-0.5 Then
ExitLong();
Else
sell();
}
if MarketPosition == 1 and crossup(c,var1+0.5) Then
ExitLong("bx");
if MarketPosition == -1 and crossdown(c,var1-0.5) Then
ExitShort("sx");
2번수식Stochastic 크로스
Input : Period1(10), Period2(5),Period3(5),P(5);
var : Stok(0),StoD(0),mav(0),T(0),Z(0);
StoK = StochasticsK(Period1,Period2);
StoD = StochasticsD(Period1,Period2,Period3);
mav = ma(c,P);
if crossup(stok,stod) and (stok < 20 즉, 침체권에있다.)
and 주가가볼린저밴드-0.5 아래에있다
Then
buy();
if CrossDown(stok,stod) and ( stok > 80 즉,과열권에있다)
and 주가가 볼린저밴드+0.5 위에있다
Then
sell();
꼭2번수식은이익목표가를별도로(Stochastic수식에매매한 신호) + - 1.00 p 에서이익실현함
3번추척청산
input : RangeMult(0.5), AtrMult(3), AtrPeriod(20);
var : PreRange(0), ChUp(0), ChDn(0), AtrVal(0), posHigh(0), posLow(0);
# 진입
PreRange = (dayHigh(1)-dayLow(1))*RangeMult;
ChUp = dayOpen + PreRange;
ChDn = dayOpen - PreRange;
If CrossUp(C, ChUp) Then
buy();
If CrossDown(C, ChDn) Then
sell();
# ATR 추적청산
ATRVal = ATR(AtrPeriod) * AtrMult;
PosHigh = Highest(H,BarssinceEntry+1);
PosLow = Lowest(L,BarsSinceEntry+1);
If MarketPosition == 1 Then
ExitLong("ATR1", AtStop, PosHigh - ATRVal);
If MarketPosition == -1 Then
ExitShort("ATR2", AtStop, PosLow + ATRVal);
위3개의수식을동시에만족하게 수식부탁합니다.
항상감사하니다.
답변 1
예스스탁 예스스탁 답변
2014-03-31 11:23:47
안녕하세요
예스스탁입니다.
1.
각 진입조건이 한봉에 동시에 만족할때로 작성했습니다.
각 조건상 동시만족으로 하시면 신호가 거의없거나 발생하지 않을 수도 있습니다.
이용에 참고하시기 바랍니다.
Input : Period1(10), Period2(5),Period3(5),P(5);
var : Stok(0),StoD(0),mav(0),T(0),Z(0);
input : RangeMult(0.5), AtrMult(3), AtrPeriod(20);
var : PreRange(0), ChUp(0), ChDn(0), AtrVal(0), posHigh(0), posLow(0);
StoK = StochasticsK(Period1,Period2);
StoD = StochasticsD(Period1,Period2,Period3);
mav = ma(c,P);
PreRange = (dayHigh(1)-dayLow(1))*RangeMult;
ChUp = dayOpen + PreRange;
ChDn = dayOpen - PreRange;
ATRVal = ATR(AtrPeriod) * AtrMult;
PosHigh = Highest(H,BarssinceEntry+1);
PosLow = Lowest(L,BarsSinceEntry+1);
var1 = BollBandUp(20,2);
var2 = BollBandDown(20,2);
if C >= O and crossup(stok,stod) and stok < 20 and C <= var2-0.5 and CrossUp(C, ChUp) Then{
buy("b1");
}
if C <= O and CrossDown(stok,stod) and stok > 80 and C >= var1+0.5 and CrossDown(C, ChDn) Then{
sell("b2");
}
if MarketPosition == 1 and crossup(c,var1+0.5) Then
ExitLong("bx");
if MarketPosition == -1 and crossdown(c,var1-0.5) Then
ExitShort("sx");
If MarketPosition == 1 Then
ExitLong("ATR1", AtStop, PosHigh - ATRVal);
If MarketPosition == -1 Then
ExitShort("ATR2", AtStop, PosLow + ATRVal);
SetStopProfittarget(1,PointStop);
2.
각 진입조건의 동시만족이 아닌 단순 3개의 식을 하나의 식으로
하나로 합치시는 내용이시면 아래식 적용하시면 됩니다.
var1 = BollBandUp(20,2);
var2 = BollBandDown(20,2);
if C >= O Then{
if C > var1+0.5 then
ExitShort();
Else
buy();
}
if C <= O Then{
if C < var2-0.5 Then
ExitLong();
Else
sell();
}
if MarketPosition == 1 and crossup(c,var1+0.5) Then
ExitLong("bx");
if MarketPosition == -1 and crossdown(c,var1-0.5) Then
ExitShort("sx");
Input : Period1(10), Period2(5),Period3(5),P(5);
var : Stok(0),StoD(0),mav(0),T(0),Z(0);
StoK = StochasticsK(Period1,Period2);
StoD = StochasticsD(Period1,Period2,Period3);
mav = ma(c,P);
if crossup(stok,stod) and stok < 20 and C <= var2-0.5 Then
buy();
if CrossDown(stok,stod) and stok > 80 and C >= var2+0.5 Then
sell();
if MarketPosition == 1 and IsExitName("b2") == true Then
ExitLong("bp",AtLimit,EntryPrice+1);
if MarketPosition == 1 and IsExitName("s2") == true Then
ExitShort("sp",AtLimit,EntryPrice-1);
input : RangeMult(0.5), AtrMult(3), AtrPeriod(20);
var : PreRange(0), ChUp(0), ChDn(0), AtrVal(0), posHigh(0), posLow(0);
# 진입
PreRange = (dayHigh(1)-dayLow(1))*RangeMult;
ChUp = dayOpen + PreRange;
ChDn = dayOpen - PreRange;
If CrossUp(C, ChUp) Then
buy();
If CrossDown(C, ChDn) Then
sell();
# ATR 추적청산
ATRVal = ATR(AtrPeriod) * AtrMult;
PosHigh = Highest(H,BarssinceEntry+1);
PosLow = Lowest(L,BarsSinceEntry+1);
If MarketPosition == 1 Then
ExitLong("ATR1", AtStop, PosHigh - ATRVal);
If MarketPosition == -1 Then
ExitShort("ATR2", AtStop, PosLow + ATRVal);
3,
질문을 올리실때 질문의 내용을 명확히 올리시기 바랍니다.
볼린져밴드의 경우 상단,중단,하단으로 구성된 지표입니다.
단순 볼린져밴드라고만 하시면 어떤 라인을 기준으로 하는지 알수 없습니다.
즐거운 하루되세요
> 큰바위얼굴 님이 쓴 글입니다.
> 제목 : 부탁합ㄴ니다
> 1번수식
var1 = BollBandUp(20,2);
var2 = BollBandDown(20,2);
if C >= O Then{
if C > var1+0.5 then
ExitShort();
Else
buy();
}
if C <= O Then{
if C < var2-0.5 Then
ExitLong();
Else
sell();
}
if MarketPosition == 1 and crossup(c,var1+0.5) Then
ExitLong("bx");
if MarketPosition == -1 and crossdown(c,var1-0.5) Then
ExitShort("sx");
2번수식Stochastic 크로스
Input : Period1(10), Period2(5),Period3(5),P(5);
var : Stok(0),StoD(0),mav(0),T(0),Z(0);
StoK = StochasticsK(Period1,Period2);
StoD = StochasticsD(Period1,Period2,Period3);
mav = ma(c,P);
if crossup(stok,stod) and (stok < 20 즉, 침체권에있다.)
and 주가가볼린저밴드-0.5 아래에있다
Then
buy();
if CrossDown(stok,stod) and ( stok > 80 즉,과열권에있다)
and 주가가 볼린저밴드+0.5 위에있다
Then
sell();
Stochastic수식에매매한 신호는 1.00 p 에서이익실현함
3번추척청산
input : RangeMult(0.5), AtrMult(3), AtrPeriod(20);
var : PreRange(0), ChUp(0), ChDn(0), AtrVal(0), posHigh(0), posLow(0);
# 진입
PreRange = (dayHigh(1)-dayLow(1))*RangeMult;
ChUp = dayOpen + PreRange;
ChDn = dayOpen - PreRange;
If CrossUp(C, ChUp) Then
buy();
If CrossDown(C, ChDn) Then
sell();
# ATR 추적청산
ATRVal = ATR(AtrPeriod) * AtrMult;
PosHigh = Highest(H,BarssinceEntry+1);
PosLow = Lowest(L,BarsSinceEntry+1);
If MarketPosition == 1 Then
ExitLong("ATR1", AtStop, PosHigh - ATRVal);
If MarketPosition == -1 Then
ExitShort("ATR2", AtStop, PosLow + ATRVal);
위3개의수식을동시에만족하게 수식부탁합니다.
항상감사하니다.
이전글