안녕하세요? 아래의 수식에서 하루매매횟수(외부변수) 를 추가하고싶습니다.
매매횟수가 있는 다른 기존의 식을 참고해봤지만, 잘 안되는군요. 부탁드립니다.
감사합니다.
input : P1(5),P2(20),N(3);
input : 익절틱수(50),손절틱수(50);
var1 = ma(c,P1);
Var2 = ma(C,P2);
Condition1 = CountIf(C>O,N) == N;
Condition2 = CountIf(C<O,N) == N;
if MarketPosition == 0 and
var1 > Var2 and
C[N+1] < O[N+1] and Condition1[1] == true and C < O Then
Sell();
if MarketPosition == 0 and
var1 < Var2 and
C[N+1] > O[N+1] and Condition2[1] == true and C > O Then
Buy();
SetStopProfittarget(PriceScale*익절틱수,PointStop);
SetStopLoss(PriceScale*손절틱수,PointStop);
답변 1
예스스탁
예스스탁 답변
2021-05-20 09:45:42
안녕하세요
예스스탁입니다.
input : P1(5),P2(20),N(3),진입횟수(3);
input : 익절틱수(50),손절틱수(50);
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;
var1 = ma(c,P1);
Var2 = ma(C,P2);
Condition1 = CountIf(C>O,N) == N;
Condition2 = CountIf(C<O,N) == N;
if MarketPosition == 0 and entry < 진입횟수 and
var1 > Var2 and
C[N+1] < O[N+1] and Condition1[1] == true and C < O Then
Sell();
if MarketPosition == 0 and entry < 진입횟수 and
var1 < Var2 and
C[N+1] > O[N+1] and Condition2[1] == true and C > O Then
Buy();
SetStopProfittarget(PriceScale*익절틱수,PointStop);
SetStopLoss(PriceScale*손절틱수,PointStop);
즐거운 하루되세요
> 대구어린울프 님이 쓴 글입니다.
> 제목 : 수식추가 부탁드립니다.
> 안녕하세요? 아래의 수식에서 하루매매횟수(외부변수) 를 추가하고싶습니다.
매매횟수가 있는 다른 기존의 식을 참고해봤지만, 잘 안되는군요. 부탁드립니다.
감사합니다.
input : P1(5),P2(20),N(3);
input : 익절틱수(50),손절틱수(50);
var1 = ma(c,P1);
Var2 = ma(C,P2);
Condition1 = CountIf(C>O,N) == N;
Condition2 = CountIf(C<O,N) == N;
if MarketPosition == 0 and
var1 > Var2 and
C[N+1] < O[N+1] and Condition1[1] == true and C < O Then
Sell();
if MarketPosition == 0 and
var1 < Var2 and
C[N+1] > O[N+1] and Condition2[1] == true and C > O Then
Buy();
SetStopProfittarget(PriceScale*익절틱수,PointStop);
SetStopLoss(PriceScale*손절틱수,PointStop);