답변완료
수식수정부탁드립니다
다음 수식에서 손절익절을 제외시켜주세요
input : 익절틱수(100),손절틱수(50);
var : v3(0),v4(0);
var1 = ma(C,20);
var2 = ma(C,120);
v3 = (DayHigh(0)+ DayLow(0))/2;
v4 = (DayHigh(0)+ DayLow(0) + DayClose(0))/3;
if var1 > var2 and v3 < v4 Then
buy("b");
if MarketPosition == 1 and v3 > v4 Then
exitlong();
if var1 < var2 and v3 > v4 Then
sell("s");
if MarketPosition == -1 and v3 < v4 Then
ExitShort();
SetStopProfittarget(PriceScale*익절틱수,PointStop);
SetStopLoss(PriceScale*손절틱수,PointStop);
2020-03-30
583
글번호 137361
시스템
답변완료
재차 질문 드림니다..
전에 질문에서 분봉 기준의 수식에서 파라볼릭 일봉 기준으로 반영을 요청하였는데
수식이 복잡하다고 하셔서요
혹시 위 그림과 같이 파라볼릭 일봉을 data2 형식의 방법으로 구현하면 가능할까요??
아래수식 + data2(일봉)의 파라볼릭 매수환경시 --> 매수 진입
========================================================
Input : RSIPeriod(7),RSI매수값(30),SimPeriod(7),심리도값(24);
Input : N1(1),초기화(7);
Input : CCI기간(20),CCI값(300),CCI값1(180);
Input : 하락틱수(15);
Input : 즉시익절1(150),즉시손절1(75);
Input : 분할매수횟수(1),분할매수틱수(50);
Input : RSIPeriod1(8),A(15),B(0);
Input : N2(0.6),N3(0.02);
Input : tr수익(100),tr하락(125);
Input : 거래량1(1600),거래량2(16000);
Input : 저점손절틱수(20);
Input : N4(0.85),N5(0.85);
Input : 본전생각틱(70);
input : P(20),dv(4.5);
var : BBup(0);
BBup = BollBandUp(P,dv);
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 < 심리도값 and RSIVV < A and RSIVV > B and v > 거래량1 and v < 거래량2 ;
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 C < O and entry == 0 Then
buy("매수",AtLimit,var1-PriceScale*하락틱수);
2020-03-30
492
글번호 137357
시스템
답변완료
안녕하세요
plot1(trendline,"TL",iff(trendline > 70 , white , red));
PlotBaseLine1(70,"LT",blue);
강조식으로 Trendline이 70을 돌파하는 캔들에 paintbar로 강조,
70을 이탈하는 캔들에 paintbar로 강조하는 수식 문의드립니다.
감사합니다.
2020-03-30
455
글번호 137341
강조
답변완료
서로다른 주기의 스토케값 구하기
Input : Period(5), FastDperiod(3), SlowDPeriod(3)
Var : oK(0), oD(0), ooK(0), ooD(0);
//3분주기 데이타
oSlowK = StochasticsK(Period,FastDperiod);
oSlowD = StochasticsD(Period,FastDperiod,SlowDPeriod);
//30분주기 데이타
ooSlowK = Data2(StochasticsK(Period,FastDperiod));
ooSlowD = Data2(StochasticsD(Period,FastDperiod,SlowDPeriod));
MessageLog("3K : %.2f, 3D : %.2f, 30k : %.2f, 30D : %.2f", oK, oD, ooK, ooD);
위와같이 작성하여 디버깅을 해보면, 3분데이타는 스토케 K, D 값은 신호오는대로 수치가 정확하게 나옵니다. 그런데 30분데이타는 스토케 K,D 값은 고정값으로 나옵니다.
어떤것이 잘못되었을까요??
2020-03-30
497
글번호 137322
시스템