예스스탁
예스스탁 답변
2021-04-16 10:36:20
안녕하세요
예스스탁입니다.
작성하신 수식에서 매수는 현재봉이 역배열, 매도는 현재봉이 정배열이어야 합니다
매수조건식에
현재봉이 sm1이 sm2보다 작은데 (sma1 < sma2)
현재봉에서 crossup(sma1,sma2)은 발생할수가 없습니다.
crossup(sma1,sma2)은 현재봉이 sma1이 sma2보다 크다라는 내용으로
서로 상충되는 조건을 한봉에서 모두 만족해야 하는 내용이므로 신호가 발생할 수 없습니다.
해당 내용이 성립하기 위해서는
전봉까지는 역배열인데 현재봉에서 crossup(sma1,sma2)이 발생하면서
역배열이 풀린것으로 매수조건을 지정하는 방법뿐이 없습니다.
매도쪽도 반대로 같습니다.
추가 문의하신 내용도 아래 내용 참고하셔서 작성해서 사용하시기 바랍니다.
Input : Period1(1), Period2(30), Period3(60), Period4(120), Period5(240),period6(480),period7(960),period8(1920);
var : Sma1(0),Sma2(0),Sma3(0),Sma4(0),Sma5(0),sma6(0),sma7(0),sma8(0);
Sma1 = ma(C,Period1);
Sma2 = ma(C,Period2);
Sma3 = ma(C,Period3);
Sma4 = ma(C,Period4);
Sma5 = ma(C,Period5);
sma6 = ma(c,period6);
sma7 = ma(c,period7);
sma8 = ma(c,period8);
Condition1 = sma1 < sma2 and sma2 < sma3 and sma3 < sma4 and sma4 < sma5 and sma5 < sma6;
Condition2 = sma1 > sma2 and sma2 > sma3 and sma3 > sma4 and sma4 > sma5 and sma5 > sma6;
if MarketPosition <= 0 and Condition1[1] == true and
CrossUp(sma1,sma2) Then
Buy("종수");
if MarketPosition >= 0 and Condition2[1] == true and
CrossDown(sma1,sma2) Then
Sell("종도");
if MarketPosition == 1 and Highest(H,BarsSinceEntry) >= EntryPrice+PriceScale*6 Then
exitLong("bx",AtStop,Highest(H,BarsSinceEntry)-PriceScale*3);
if MarketPosition == -1 and lowest(L,BarsSinceEntry) <= EntryPrice-PriceScale*6 Then
ExitShort("sx",AtStop,lowest(L,BarsSinceEntry)+PriceScale*3);
SetStopLoss(PriceScale*30,PointStop);
즐거운 하루되세요
> tnsflwls 님이 쓴 글입니다.
> 제목 : 시스템 수정 의뢰
> 수고 하십니다 !
Input : Period1(1), Period2(30), Period3(60), Period4(120), Period5(240),period6(480),period7(960),period8(1920);
var : Sma1(0),Sma2(0),Sma3(0),Sma4(0),Sma5(0),sma6(0),sma7(0),sma8(0);
Sma1 = ma(C,Period1);
Sma2 = ma(C,Period2);
Sma3 = ma(C,Period3);
Sma4 = ma(C,Period4);
Sma5 = ma(C,Period5);
sma6 = ma(c,period6);
sma7 = ma(c,period7);
sma8 = ma(c,period8);
if MarketPosition <= 0 and sma1 < sma2 and sma2 < sma3 and sma3 < sma4 and sma4 < sma5 and sma5 < sma6 and
CrossDown (sma1,sma2) Then
Buy("종수");
if MarketPosition >= 0 and sma1 > sma2 and sma2 > sma3 and sma3 > sma4 and sma4 > sma5 and sma5 > sma6 and
CrossUp(sma1,sma2) Then
Sell("종도");
if MarketPosition == 1 and Highest(H,BarsSinceEntry) >= EntryPrice+PriceScale*6 Then
ExitLong("bx",AtStop,Highest(H,BarsSinceEntry)-PriceScale*3);
if MarketPosition == -1 and lowest(L,BarsSinceEntry) <= EntryPrice-PriceScale*6 Then
ExitShort("sx",AtStop,lowest(L,BarsSinceEntry)+PriceScale*3);
SetStopLoss(PriceScale*30,PointStop);
위 수식에서 매수 는 crossup(sma1,sma2) 을 대입 해야 할것 같은데 신호 가 안나오고
crossdown 을 대입 하면 신호 가 나오네요 ,,,
정배열 된 다음 1 이평선 이 240 이평선 을 crossdown 할때 5 틱 올려서 매도 를 하고
역배열 된 다음 1 이평선 이 240 이평선 을 crossup 할때 5 틱 내려서 매수를 하는
수식 을 부탁 드립니다.
***** 수고 하세요 *****