예스스탁
예스스탁 답변
2021-03-25 09:58:54
안녕하세요
예스스탁입니다.
1
input : 매수기준선(0.05),매도기준선(0.05),n(5);
input : 익절틱수(50),손절틱수(50),진입횟수(3);
input : P1(5),P2(20);
var : BB(0),SS(0),BI(0),BC(0),SI(0),SC(0),entry(0),mav1(0),mav2(0);
mav1 = ma(c,P1);
mav2 = ma(C,P2);
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;
BB = Floor(O)+0.05;
if O >= BB Then
BB = BB+1;
SS = Floor(O)+0.05;
if O <= SS Then
SS = SS-1;
if O < BB and C >= BB and C > O Then
{
BI = Index;
BC = C;
}
if O > SS and C <= SS and C < O Then
{
SI = Index;
SC = C;
}
if MarketPosition == 0 and BI > 0 and Index > BI and Index < BI+n and C > O and C == BC and entry < 진입횟수 and mav1 < mav2 Then
Buy();
if MarketPosition == 0 and SI > 0 and Index > SI and Index < SI+n and C < O and C == SC and entry < 진입횟수 and mav1 > mav2 Then
Sell();
SetStopProfittarget(PriceScale*익절틱수,PointStop);
SetStopLoss(PriceScale*손절틱수,PointStop);
2
input : n(5);
input : 익절틱수(50),손절틱수(50),진입횟수(3);
input : P1(5),P2(20);
var : BB(0),SS(0),BI(0),BC(0),SI(0),SC(0),entry(0),mav1(0),mav2(0);
mav1 = ma(c,P1);
mav2 = ma(C,P2);
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 C > O then
{
var1 = C;
Var2 = var1[1];
Var3 = Index;
Var4 = Var3[1];
if MarketPosition == 0 and var1 == Var2 and Var3 <= Var4+n and entry < 진입횟수 and mav1 < mav2 Then
Buy();
}
if C < O then
{
var5 = C;
Var6 = var5[1];
Var7 = Index;
Var8 = Var7[1];
if MarketPosition == 0 and var5 == Var6 and Var7 <= Var8+n and entry < 진입횟수 and mav1 > mav2 Then
Sell();
}
SetStopProfittarget(PriceScale*익절틱수,PointStop);
SetStopLoss(PriceScale*손절틱수,PointStop);
즐거운 하루되세요
> 대구어린울프 님이 쓴 글입니다.
> 제목 : 수식추가 부탁드립니다.
> 안녕하세요?
아래수식2가지에 간단한 수식추가 부탁드립니다.
[1]과 [2]모두 이동평균선 2개 추가(외부변수)
현재방식그대로이되, 정배열에서 매도, 역배열에서 매수가 되게끔 하고싶습니다.
감사합니다.
[1]
input : 매수기준선(0.05),매도기준선(0.05),n(5);
input : 익절틱수(50),손절틱수(50),진입횟수(3);
var : BB(0),SS(0),BI(0),BC(0),SI(0),SC(0),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;
BB = Floor(O)+0.05;
if O >= BB Then
BB = BB+1;
SS = Floor(O)+0.05;
if O <= SS Then
SS = SS-1;
if O < BB and C >= BB and C > O Then
{
BI = Index;
BC = C;
}
if O > SS and C <= SS and C < O Then
{
SI = Index;
SC = C;
}
if MarketPosition == 0 and BI > 0 and Index > BI and Index < BI+n and C > O and C == BC and entry < 진입횟수 Then
Buy();
if MarketPosition == 0 and SI > 0 and Index > SI and Index < SI+n and C < O and C == SC and entry < 진입횟수 Then
Sell();
SetStopProfittarget(PriceScale*익절틱수,PointStop);
SetStopLoss(PriceScale*손절틱수,PointStop);
[2]
input : n(5);
input : 익절틱수(50),손절틱수(50),진입횟수(3);
var : BB(0),SS(0),BI(0),BC(0),SI(0),SC(0),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 C > O then
{
var1 = C;
Var2 = var1[1];
Var3 = Index;
Var4 = Var3[1];
if MarketPosition == 0 and var1 == Var2 and Var3 <= Var4+n and entry < 진입횟수 Then
Buy();
}
if C < O then
{
var5 = C;
Var6 = var5[1];
Var7 = Index;
Var8 = Var7[1];
if MarketPosition == 0 and var5 == Var6 and Var7 <= Var8+n and entry < 진입횟수 Then
Sell();
}
SetStopProfittarget(PriceScale*익절틱수,PointStop);
SetStopLoss(PriceScale*손절틱수,PointStop);