답변완료
손절식 수정 문의 드립니다.
항상 많은 도움 감사드립니다. 아래와 같이 시스템 식을 작성하였는데 생각대로 작동하지 않는 부분이 있어서 수정 문의 드립니다.
Q&A 관리자 분의 도움으로 아래와 같이 작성을 하였는데요..
MarketPosition == -1 매도 포지션 일때는 stoploss가 제대로 작동하는데
MarketPosition == 1 매수 포지션 일때 stoploss 가 작동을 하지 않습니다.
어떤 부분을 수정해야 하나요? 혹은 다른 시스템식으로 작성을 하여야 하나요?
매도,매수 모두 분할청산 및 청산은 문제없이 작동합니다.
///////////////////////////////////////////////////////////////
if MarketPosition == 1 Then
{
if IsEntryName("A매수") == true Then
{
ExitLong("Sp1",AtLimit,EntryPrice+20,"",1,1);
SetStopLoss(20,PointStop);
if A-1 Then
ExitLong("A매수정리",atmarket,def,"A매수");
}
if IsEntryName("b매수") == true Then
{
ExitLong("Sp2",AtLimit,EntryPrice+10,"",1,1);
SetStopLoss(10,PointStop);
if A-1 Then
ExitLong("B매수정리",atmarket,def,"B매수");
}
}
Else
SetStopLoss(0);
////////////////////////////////////////////////////////////////////////
if MarketPosition == -1 Then
{
if IsEntryName("A매도") == true Then
{
Exitshort("Bp1",AtLimit,EntryPrice-20,"",1,1);
SetStopLoss(20,PointStop);
if A-1 Then
Exitshort("A매도정리",atmarket,def,"A매도");
}
if IsEntryName("b매도") == true Then
{
Exitshort("Bp2",AtLimit,EntryPrice-10,"",1,1);
SetStopLoss(10,PointStop);
if B-1 Then
ExitLong("B매도정리",atmarket,def,"B매도");
}
}
Else
SetStopLoss(0);
2023-12-05
632
글번호 174602
시스템
답변완료
문의 드립니다.
[지표1]
수식1
r=rsi(기간);
(highest(r,short)+lowest(r,short)+highest(r,mid)+lowest(r,mid))/4
수식2
r=rsi(기간);
(highest(r,long)+lowest(r,long))/2
[지표2]
수식4
r=rsi(기간);
a=(highest(r,short)+lowest(r,short)+highest(r,mid)+lowest(r,mid))/4;
if(a>=50,a,50)
수식5
r=rsi(기간);
a=(highest(r,long)+lowest(r,long))/2;
if(a>=50,a,50)
[지표3]
수식4
r=rsi(기간);
a=(highest(r,short)+lowest(r,short)+highest(r,mid)+lowest(r,mid))/4;
if(a<=50,a,50)
수식5
r=rsi(기간);
a=(highest(r,long)+lowest(r,long))/2;
if(a<=50,a,50)
short : 9
long : 26
mid : 52
기간 : 14
위 수식은 올린 이미지의 수식인데
50선을 기준으로 상하 다른 색으로 나누어져 있습니다.
위 수식을 합쳐서
일목균형표 구름대처럼 양운과 음운의 색을 다르게해서 예스수식으로 만들어주세요.
2023-12-05
1233
글번호 174599
지표
답변완료
전환추세 크기
Input : 전환(0.2);
Var:j(0),jj(0),HH(0),LL(0),hiBar(0),loBar(0),최종꼭지점(""),처리구분(""),TL1(0),Tx(0);
Array:고[10,4](0),저[10,4](0);
HH = H;
LL = L;
If Index == 0 Then
{
고[1,1] = HH;
고[1,2] = 0;
고[1,3] = sDate;
고[1,4] = sTime;
저[1,1] = LL;
저[1,2] = 0;
저[1,3] = sDate;
저[1,4] = sTime;
}
If Index > 0 Then
{
hiBar = hiBar + 1;
loBar = loBar + 1;
}
If HH[hiBar] < HH Then hiBar = 0;
If LL[loBar] > LL Then loBar = 0;
Condition1 = 저[1,1]+전환 <= HH and hiBar == 0;
Condition2 = 고[1,1]-전환 >= LL and loBar == 0;
처리구분 = "";
If Condition1 and Condition2 Then
{
If 최종꼭지점 == "저점" Then
{
If 저[1,1] > LL Then 처리구분 = "저점처리";
Else 처리구분 = "고점처리";
}
Else If 최종꼭지점 == "고점" Then
{
If 고[1,1] < HH Then 처리구분 = "고점처리";
Else 처리구분 = "저점처리";
}
}
Else If Condition1 Then 처리구분 = "고점처리";
Else If Condition2 Then 처리구분 = "저점처리";
If 처리구분 == "고점처리" Then
{
If 최종꼭지점 == "저점" Then
{
For j = 10 DownTo 2
{
For jj = 1 To 4
{
고[j,jj] = 고[j-1,jj];
}
}
고[1,1] = HH[hiBar];
고[1,2] = Index - hiBar;
고[1,3] = sDate[hiBar];
고[1,4] = sTime[hiBar];
hiBar = -1;
loBar = -1;
TL1 = TL_New(저[1,3],저[1,4],저[1,1],고[1,3],고[1,4],고[1,1]);
TL_SetSize(TL1,2);
TL_SetColor(TL1,RED);
}
Else If 고[1,1] < HH[hiBar] Then
{
고[1,1] = HH[hiBar];
고[1,2] = Index - hiBar;
고[1,3] = sDate[hiBar];
고[1,4] = sTime[hiBar];
hiBar = -1;
loBar = -1;
TL_SetEnd(TL1,고[1,3],고[1,4],고[1,1]);
}
최종꼭지점 = "고점";
}
If 처리구분 == "저점처리" Then
{
If 최종꼭지점 == "고점" Then
{
For j = 10 DownTo 2
{
For jj = 1 To 4
{
저[j,jj] = 저[j-1,jj];
}
}
저[1,1] = LL[loBar];
저[1,2] = Index - loBar;
저[1,3] = sDate[loBar];
저[1,4] = sTime[loBar];
hiBar = -1;
loBar = -1;
TL1 = TL_New(고[1,3],고[1,4],고[1,1],저[1,3],저[1,4],저[1,1]);
TL_SetSize(TL1,2);
TL_SetColor(TL1,BLUE);
if 고[1,1] <= 고[2,1] + PriceScale* 1 and 고[1,1] >= 고[2,1] - PriceScale* 1 Then
{
Sell();
}
}
Else If 저[1,1] > LL[loBar] Then
{
저[1,1] = LL[loBar];
저[1,2] = Index - loBar;
저[1,3] = sDate[loBar];
저[1,4] = sTime[loBar];
hiBar = -1;
loBar = -1;
TL_SetEnd(TL1,저[1,3],저[1,4],저[1,1]);
}
최종꼭지점 = "저점";
}
if MarketPosition == 1 and BarsSinceEntry == 1 Then ExitLong();
if MarketPosition == -1 and BarsSinceEntry == 1 Then ExitShort();
하락추세선의 크기가 0.7p 이상일때 양전환되면 매수 추가. 다음봉에 매수청산. 감사합니다.
2023-12-05
1090
글번호 174582
시스템
답변완료
수식수정
예스스탁
input : P(20),dv(2),T(100),N(10);
var : bbup(0),bbdn(0),bbmd(0);
Input : 당일수익틱수(100);
Var : N1(0),dayPl(0),당일수익(0);
var : Xcond(false);
if Bdate != Bdate[1] Then
{
Xcond = False;
}
당일수익 = PriceScale*당일수익틱수;
if Bdate != Bdate[1] Then
{
Xcond = false;
N1 = NetProfit;
}
daypl = NetProfit-N1;
if TotalTrades > TotalTrades[1] then
{
if daypl >= 당일수익 Then
Xcond = true;
if (IsExitName("dbp",1) == true or IsExitName("dsp",1) == true) then
Xcond = true;
}
bbup = BollBandUp(P,dv);
bbmd = ma(c,P);
bbdn = BollBandDown(P,dv);
if Xcond == false then
{
if CountIf(BBup <= BBdn+PriceScale*T,N) == N Then
{
if MarketPosition <= 0 and CrossUp(C,BBup) Then
Buy();
if MarketPosition >= 0 and CrossDown(C,BBdn) Then
Sell();
if MarketPosition == 0 and MarketPosition(1) == 1 and IsExitName("bx",1) == true and CrossUp(C,bbmd) Then
Buy();
if MarketPosition == 0 and MarketPosition(1) == -1 and IsExitName("sx",1) == true and CrossDown(C,bbmd) Then
Sell();
}
}
if MarketPosition == 1 then
{
if CrossDown(C,bbmd) Then
ExitLong("bx");
ExitLong("dbp",atlimit,EntryPrice+((당일수익-daypl)/CurrentContracts));
}
if MarketPosition == -1 then
{
if Crossup(C,bbmd) Then
ExitShort("sx");
ExitShort("dsp",atlimit,EntryPrice-((당일수익-daypl)/CurrentContracts));
}
안녕하세요
위식에서 수식수정 부탁드림니다
현100틱이내10캔들이내 횡보진입을
100틱이내 10캔들이상 횡보후진입으로
수정부탁드려요
2023-12-05
1055
글번호 174580
시스템