답변완료
문의
진입명이 아래와 같습니다.
b1,b2,b3
s1,s2,s3
리버스 거래 때
b1,s1 (진입순서에 따라 손절구분)
고점돌파할 때 b2,b3
저점돌파할 때 s2,s3
위와 같이 진입할 때 아래 청산식을 작성했습니다.
하나의 거래수식에서 청산식을 이렇게 나열만 해도 되는지 살펴주십시요.
******************************************************************************
input : ls1(1),gl1(8.75),tr1(2);
input : ls4(1),gl4(6.75),tr4(2);
input : ls2(1),gl2(7.75),tr2(2);
input : ls3(1),gl3(2),tr3(2);
input : bbls(1),bbgl(999999),bbtr(1);
input : bsls(2),bsgl(999999),bstr(2.75);
input : sbls(3.25),sbgl(999999),sbtr(4.5);
input : ssls(1),ssgl(3.5),sstr(1);
var : entry(0);
if Bdate != Bdate[1] Then
entry = 0;
if (MarketPosition != 0 and MarketPosition != MarketPosition[1]) or
(MarketPosition == MarketPosition[1] and TotalTrades > TotalTrades[1]) Then
entry = entry+1;
if MarketPosition == 1 Then
{
//매수진입이 첫진입일때
if entry == 1 Then
{
SetStopLoss(ls1,PointStop);
SetStopProfittarget(gl1,PointStop);
SetStopTrailing(tr1,0,PointStop);
}
Else //매수진입이 두번째진입일때
{
SetStopLoss(ls3,PointStop);
SetStopProfittarget(gl3,PointStop);
SetStopTrailing(tr3,0,PointStop);
}
}
Else if MarketPosition == -1 Then
{
//매도진입이 첫진입일때
if entry == 1 Then
{
SetStopLoss(ls2,PointStop);
SetStopProfittarget(gl2,PointStop);
SetStopTrailing(tr2,0,PointStop);
}
Else //매수진입이 두번째진입일때
{
SetStopLoss(ls4,PointStop);
SetStopProfittarget(gl4,PointStop);
SetStopTrailing(tr4,0,PointStop);
}
}
if MarketPosition== 1 Then
{
if IsEntryName("b2") == true Then
{
SetStopLoss(bbls,PointStop);
SetStopProfittarget(bbgl,PointStop);
SetStopTrailing(bbtr,0,PointStop,1);
}
Else if IsEntryName("b3") == true Then
{
SetStopLoss(bsls,PointStop);
SetStopProfittarget(bsgl,PointStop);
SetStopTrailing(bstr,0,PointStop,1);
}
}
if MarketPosition== -1 Then
{
if IsEntryName("s2") == true Then
{
SetStopLoss(sbls,PointStop);
SetStopProfittarget(sbgl,PointStop);
SetStopTrailing(sbtr,0,PointStop,1);
}
Else if IsEntryName("s3") == true Then
{
SetStopLoss(ssls,PointStop);
SetStopProfittarget(ssgl,PointStop);
SetStopTrailing(sstr,0,PointStop,1);
}
}
2025-03-26
356
글번호 189568
시스템
답변완료
수식수정
input : N(120),Per(30);
var : A1(0),A2(0),mav(0),hh(0),ll(0);
A1=LRL(C,20);
A2=LRL(C,40);
if CrossUp(A1,A2) Then
var1 = A1;
mav = ma(C,10);
if var1[1] > mav[1] and
var1 < mav and C>O and
var1[5]==var1[4]==var1[3]==var1[2]==var1[1]==var1 Then
Find(1);
위는 어제 주신(92053) 2번수식의 일부 "var1[1]==var1 Then"을
var1[5]==var1[4]==var1[3]==var1[2]==var1[1]==var1 로 고쳐
5봉전부터 0봉전까지 모두 var1이 동일하게 되도록(즉,var1값이 수평이 되도록)
만들어보니 문법에러가 나는데,
어느 게 잘못된건지 보시고 수정부탁 드립니다.
2025-03-26
391
글번호 189551
종목검색