답변완료
수식수정부탁드립니다
input : 카운팅시작일자(20191001),카운팅시작시간(101500);
var : XClose(0),Xopen(0),Xhigh(0),Xlow(0),Tcond(false),DO(0);
if sdate >= 카운팅시작일자 and stime >= 카운팅시작시간 Then
Tcond = true;
xClose = (Open+High+Low+Close)/4;
if CurrentBar <= 1 Then
Xopen = (O+C)/2;
Else
xOpen = (XOpen[1] + xClose[1])/2;
xHigh = Max(High, xOpen, xClose);
xLow = Min(Low, xOpen, xClose);
var1=xHigh;
var2=xLow;
if Tcond == true then
{
if bdate != bdate[1] Then
DO = (DayHigh+daylow+dayopen+DayClose)/4;
if c>do then
{
Plot3(var1, "중심상",iff(do>=0,RED,BLUE));
}
Else
{
Plot3(var2, "중심상",iff(do>=0,BLUE,red));
}
PlotBaseLine1(do, "중심",black);
}
상기수식에서 9172.94 을 기준라인으로 오실레이터를 만들고 싶습니다.
기준(9172.94)라인 중심으로 상부는 빨간색 하부는 파란색이 나타나도록 수식 수정 부탁드립니다.
감사합니다
2020-01-20
262
글번호 135268
지표
답변완료
기존수식에 볼린저밴드 (하단선 위치) 조건 추가 식 요청
아래 기존 수식에 볼린저 밴드 하단에 있을때 진입 조건을 추가하려합니다.
볼린저 밴드 변수값은 (기간 20 변동폭은 1.5 )
아래 기존 수식에 볼린저 밴드 하단선 밑에 있을때만 진입을 기존 수식과 교집합일때 적용하
는 수식 부탁드려요.
====================================================================================
Input : RSIPeriod(14),RSI매수값(39),SimPeriod(14),심리도값(24);
Input : N1(1),초기화(7);
Input : CCI기간(20),CCI값(350);
Input : 하락틱수(5);
Input : 즉시익절1(140),즉시손절1(100);
Input : 분할매수횟수(2),분할매수틱수(60);
Input : RSIPeriod1(8),A(35);
Input : N2(0.7),N3(0.3);
var : cnt(0),SigSum(0),count2(0),RSIsig(0);
Var : Counter(0), DownAmt(0), UpAmt(0), UpSum(0), DownSum(0), UpAvg(0), DownAvg(0);
var : idx(0), PreUpAvg(0), preDownAvg(0),RSIVv(0);
Array : C1[100](0);
var : CCIv(0),RSIv(0),Simri(0),BuySetup(false),DD(0),entry(0);
CCIv = CCI(CCI기간);
RSIV = RSI(RSIPeriod);
Simri = Simrido(SimPeriod);
if Bdate != Bdate[1] Then
{
for cnt = 1 to 99
{
C1[cnt] = C1[cnt-1][1];
}
PreUpAvg = UpAvg[1];
preDownAvg = DownAvg[1];
idx = idx + 1;
}
C1[0] = C;
If idx == RSIPeriod1+2 Then
{
UpSum = 0;
DownSum = 0;
For Counter = 0 To RSIPeriod1 - 1
{
UpAmt = C1[Counter] - C1[Counter+1];
If UpAmt >= 0 Then
DownAmt = 0;
Else
{
DownAmt = -UpAmt;
UpAmt = 0;
}
UpSum = UpSum + UpAmt;
DownSum = DownSum + DownAmt;
}
UpAvg = UpSum / RSIPeriod1;
DownAvg = DownSum / RSIPeriod1;
}
If idx > RSIPeriod1+2 Then
{
UpAmt = C1[0] - C1[1];
If UpAmt >= 0 Then
DownAmt = 0;
Else
{
DownAmt = -UpAmt;
UpAmt = 0;
}
UpAvg = (PreUpAvg * (RSIPeriod1 - 1) + UpAmt) / RSIPeriod1;
DownAvg = (preDownAvg * (RSIPeriod1 - 1) + DownAmt) / RSIPeriod1;
}
If UpAvg + DownAvg <> 0 Then
RSIvv = 100 * UpAvg / (UpAvg + DownAvg);
Else
RSIvv = 0;
if bdate != bdate[1] Then
{
Entry = 0;
Condition2 = true;
}
if MarketPosition != 0 and MarketPosition != MarketPosition[1] Then
entry = entry+1;
if TotalTrades > TotalTrades[1] and
(IsExitName("즉시손절1",1) == true or IsExitName("본전청산1",1)) then
Condition2 = false;
Condition1 = RSIv < RSI매수값 and Simri < 심리도값;
if bdate != bdate[1] Then
{
DD = DD+1;
if var2 > 0 and DD == var2+초기화 Then
BuySetup = false;
}
if BuySetup == false and Condition1 == true and Condition1[1] == false Then
{
var1 = C;
var2 = DD;
BuySetup = true;
}
if Condition2 == true and MarketPosition == 0 and BuySetup == true and RSIVV > A Then
buy("매수",AtLimit,var1-PriceScale*하락틱수);
2020-01-20
321
글번호 135267
시스템