답변완료
수식변환요
안녕하세요 아래의 수식을 예스 변경 부탁드립니다.
양봉의시가 음봉의고가 에 선이 그으지도록...
양봉시가
양=C>O;
음=C<O;
양시 = if(양, O, 0);
첫시가 = ValueWhen(1, 음 && 양(1) && 양(2) && 양(3), Highest(O(1),3));
HH = HighestSince(1, 음 && 양(1) && 양(2) && 양(3), 양시);
SHIFT(ValueWhen(1, 음, Max(첫시가, HH)),N)
음봉고가
양=C>O;
음=C<O;
음고 = if(음, H, 9999999);
첫고가 = ValueWhen(1, 양 && 음(1) && 음(2) && 음(3), Lowest(H(1),3));
LL = LowestSince(1, 양 && 음(1) && 음(2) && 음(3), 음고);
SHIFT(ValueWhen(1, 양, Min(첫고가, LL)),N)
2023-04-27
865
글번호 168550
지표
답변완료
전환 추세선 쓰리바닥
Input : 전환(0.25);
Var:j(0),jj(0),HH(0),LL(0),hiBar(0),loBar(0),최종꼭지점(""),처리구분(""), TL1(0),TX1(0),tx(0);
Array:고[10,4](0),저[10,4](0);
Plot1(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
{
Text_Delete(tx);
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]);
Text_SetString(TX1,NumToStr(고[1,1]-저[1,1],2));
Text_SetLocation(TX1,고[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);
}
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]);
Text_SetString(TX1,NumToStr(저[1,1]-고[1,1],2));
Text_SetLocation(TX1,저[1,3],저[1,4],저[1,1]);
}
최종꼭지점 = "저점";
Text_Delete(tx);
if sTime >= 93000 and 저[1,1] <= DayLow+0.1 and 저[1,1] >= DayLow-0.25 Then
{
tx = text_new(저[1,3],저[1,4],저[1,1]+PriceScale*5,"●");
Text_SetStyle(tx,2,2);
Text_SetColor(tx,Magenta);
Text_SetSize(tx,20);
}
}
하락추세선 3개의 저점이 0.15p(3틱) 내에서 쓰리바닥 형성시 동그라미 표시. 감사합니다.
2023-04-27
1068
글번호 168541
지표
답변완료
수정부탁드립니다.
작성해주신 시스템식이 매도만 진입합니다.
매수도 진입할수 잇도록 수정 부탁드립니다.
///////////////////////////////////////////
input : P1(20),P2(60),조정틱(5),감시틱수(10);
var : mav1(0),mav2(0),T(0),B(0),S(0);
mav1 = ma(C,P1);
mav2 = ma(C,P2);
if CrossUp(mav1,mav2) Then
{
T = 1;
B = C;
}
if CrossDown(mav1,mav2) Then
{
T = -1;
S = C;
}
if T == 1 and S > 0 Then
Buy("b",AtStop,S+PriceScale*조정틱);
if T == -1 Then
Sell("S",AtStop,S-PriceScale*조정틱);
if MarketPosition == 1 Then
{
B = 0;
if highest(H,BarsSinceEntry) >= EntryPrice+감시틱수 Then
ExitLong("bx",AtStop,EntryPrice);
}
if MarketPosition == -1 Then
{
S = 0;
if Lowest(L,BarsSinceEntry) <= EntryPrice-감시틱수 Then
ExitShort("sx",AtStop,EntryPrice);
}
2023-04-27
882
글번호 168538
시스템