답변완료
문의드립니다.
안녕하세요.
아래 지표를 표시하고 싶습니다.
어떤 분봉, 틱봉을 선택하던지.
이전, 60분봉의 [시가, 고가, 저가, 종가]가 표시되었으면 합니다.
예를 들면, 10시 20분 정도에 5분봉이 그려지고 있을 때에는, 직전 60분봉이니까 9시~10시의 60분봉 시고저종가를 표시하고,
오후 1시5분이라면, 12시~1시까지의 시고저종을 선으로 표시하는 것입니다.
장시작할 때에는 직전에 그려진 시고저종이 표시되면 됩니다.
감사합니다.
2020-01-17
158
글번호 135226
지표
답변완료
수식검토 요청
20일동안의 최고가를 돌파하며 매수진입
10일동안의 최저가를 하향돌파하면 매수청산
20일동안의 최저가를 하량돌파하며 매도진입
10일동안의 최고가를 상향돌파하면 매도청산
아래와 같이 작성해봤는데, 매매결과가 나오질 않네요
수식검토를 요청드립니다
Input : 진입수량(1),N(20),N2(10),
목표수익(1000000),스탑로스(10000);
var : h1(0),L1(0),h2(0),L2(0);
h1 = highest(h,N);
L1 = Lowest(L,N2);
h2 = highest(h,N2);
L2 = Lowest(L,N);
if MarketPosition <= 0 and crossup(C,h1) Then
buy();
if MarketPosition == 1 and CrossDown(C,L1) Then
ExitLong();
if MarketPosition >= 0 and CrossDown(C,L2) Then
sell();
if MarketPosition == -1 and CrossUp(C,h2) Then
ExitShort();
# 목표수이익
# SetStopProfittarget(목표수익,PointStop);
# 스탑로스
SetStopLoss(스탑로스,PointStop);
2020-01-17
167
글번호 135223
시스템
답변완료
색상 지정 요청 좀 부탁 드립니다.
* 한주 동안 수고 하셨습니다. 좋은 주말 되십시요^^
* 색상 지정이 안되는데 불가능 한가요?
기준: var1 이 var2 보다 크면 red var1 이 var2 보다 작으면 blue
var1 = ma(c,5) :
var2 = ma(c,10) ;
var3 = ma(c,30) ;
var4 = ma(c,40) ;
var5 = ma(c,50) ;
plot1(var1,"1",red, def,1 , var1 > var2 ) ;
plot2(var1,"1",blue,def,1 , var1 < var2 ) ;
plot3(var2,"2",red,def,1 , var2 > var3 ) ;
plot4(var2,"2",blue,def,1 , var2 < var3 ) ;
* 고맙습니다.
2020-01-17
112
글번호 135211
지표
답변완료
특정 지정 거래 발생후 당일 거래 제한 수식 추가건
익절 청산시에는 당일 추가 거래가 되고
손절발생시 당일 거래 안하고 그다음날부터 거래가되는 수식입니다.
그런데 문제가 생겼네요.. 부가적으로 어느정도 수익중에 있다가 진입가 근처에
도달시 "본절청산1"이라는 청산이름으로 정했고 해당 매매 발생시에도 손실청산 과 같이
당일 거래가 제한되게 하는 식을 부가적으로 부탁드리겠습니다.
======================================
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 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*하락틱수);
#추가진입
if MarketPosition == 1 and MaxEntries < 분할매수횟수 Then
buy("추가매수",atlimit,LatestEntryPrice(0)-PriceScale*분할매수틱수,1);
if MarketPosition == 1 then
{
BuySetup = false;
if countif(CrossDown(CCIv,CCI값),BarsSinceEntry) >= 1 and
CCIv < CCI값 and C < O Then
ExitLong("매수cci청산");
if highest(H,BarsSinceEntry) >= EntryPrice+PriceScale*즉시익절1 and C < O Then
ExitLong("즉시익절1");
if highest(H,BarsSinceEntry) >= (EntryPrice+PriceScale*즉시익절1*N2) Then
ExitLong("본전청산1",AtStop,EntryPrice+PriceScale*즉시익절1*N3);
Else
ExitLong("즉시손절1",AtStop,EntryPrice-PriceScale*즉시손절1);
}
2020-01-16
119
글번호 135210
시스템
답변완료
함수요청
안녕하세요?
아래 답변주신 글번호 65664번 재질문입니다.
작성주신 스크립트에 진입횟수를 최대 N번까지 변수로 설정하고 싶습니다.
Input : P1(20),D1(2), P2(20),D2(2);
var : BBmd1(0,data1),BBup1(0,data1),BBdn1(0,data1);
var : BBmd2(0,data2),BBup2(0,data2),BBdn2(0,data2);
BBmd1 = data1(ma(C,P1));
BBup1 = data1(BollBandUp(P1,D1));
BBdn1 = data1(BollBandDown(P1,D1));
BBmd2 = data2(ma(C,P2));
BBup2 = data2(BollBandUp(P2,D2));
BBdn2 = data2(BollBandDown(P2,D2));
if data1(stime >= 101500 and stime < 170000) Then
{
if MarketPosition <= 0 and data1(O < BBmd1) Then
buy("b",AtMarket);
if MarketPosition >= 0 and data1(O > BBmd1) Then
sell("s",AtMarket);
if MarketPosition == 1 and data2(L < BBdn2) and data2(stime) >= data1(stime[BarsSinceEntry]) Then
ExitLong("bx",AtMarket);
if MarketPosition == -1 and data2(H > BBup2) and data2(stime) >= data1(stime[BarsSinceEntry]) Then
ExitShort("sx",AtMarket);
}
SetStopEndofday(170000);
2020-01-16
116
글번호 135208
시스템