안녕하세요?
부동작 이유 부탁드립니다
SL2 > 0, SH2 > 0 가 어떤 역할 인가요?
if SwingLow(1,L,Left,right,Left+right+1) != -1 Then
{
#최근저점이 전저점보다 크면 매수
if SL1 > SL2 and SL2 > 0 Then
buy();
}
if SwingHigh(1,H,Left,right,Left+right+1) != -1 Then
{
#최근고점이 전고점보다 작으면 매도
if SH1 < SH2 and SH2 > 0 Then
sell();
}
input : SL(70),SPR(1.2);
SetStopContract;
SetStopLoss(SL,PointStop);
SetStopProfittarget(SL*SPR,PointStop);
답변 1
예스스탁
예스스탁 답변
2023-08-24 14:02:03
안녕하세요
예스스탁입니다.
변수의 기본값이 기본이 0 이므로 0보다 큰것은 값이 저장된것을 의미합니다.
지정한 변수에 값저장이 없어 추가해 드립니다.
input : left(3),right(3);
var : sl1(0),sl2(0),sh1(0),sh2(0);
if SwingLow(1,L,Left,right,Left+right+1) != -1 Then
{
sl1 = l[right];
sl2 = sl1[1];
#최근저점이 전저점보다 크면 매수
if SL1 > SL2 and SL2 > 0 Then
buy();
}
if SwingHigh(1,H,Left,right,Left+right+1) != -1 Then
{
sh1 = h[right];
sh2 = sh1[1];
#최근고점이 전고점보다 작으면 매도
if SH1 < SH2 and SH2 > 0 Then
sell();
}
input : SL(70),SPR(1.2);
SetStopContract;
SetStopLoss(SL,PointStop);
SetStopProfittarget(SL*SPR,PointStop);
즐거운 하루되세요
> 코퍼 님이 쓴 글입니다.
> 제목 : swinghigh
>
안녕하세요?
부동작 이유 부탁드립니다
SL2 > 0, SH2 > 0 가 어떤 역할 인가요?
if SwingLow(1,L,Left,right,Left+right+1) != -1 Then
{
#최근저점이 전저점보다 크면 매수
if SL1 > SL2 and SL2 > 0 Then
buy();
}
if SwingHigh(1,H,Left,right,Left+right+1) != -1 Then
{
#최근고점이 전고점보다 작으면 매도
if SH1 < SH2 and SH2 > 0 Then
sell();
}
input : SL(70),SPR(1.2);
SetStopContract;
SetStopLoss(SL,PointStop);
SetStopProfittarget(SL*SPR,PointStop);