답변완료
체결강도를 추가하고 싶습니다.
안녕하십니까?
아래 수식에다가 1분봉상 체결강도 100이상을 추가하여 검색하고 싶습니다.
input : length(21),hh(8),mult(2),k(2);
var : src(0),n(0),tx(0),sume(0),i(0),j(0),y2(0),sum(0),sumw(0),w(0),mae(0),A(0),A1(0),A2(0),A3(0);
src = Close;
n = barindex;
sume = 0;
for i = 0 to length-1
{
sum = 0;
sumw = 0;
for j = 0 to length-1
{
w = exp(-(pow(i-j,2)/(hh*hh*2)));
sum = sum+src[j]*w;
sumw = sumw+w;
}
y2 = sum/sumw;
sume = sume+abs(src[i] - y2);
}
mae = sume/length*mult;
A=y2;
A1=y2+mae;
A2=y2-mae;
input : keyvalue(1),atrperiod(10);
var : xATR(0),nLoss(0),xATRTrailingStop(0),pos(0),xcolor(0);
src = close ;
xATR = atr(atrperiod);
nLoss = keyvalue * xATR;
xATRTrailingStop = iff(src > xATRTrailingStop[1] and src[1] > xATRTrailingStop[1], max(xATRTrailingStop[1], src - nLoss),
iff(src < xATRTrailingStop[1] and src[1] < xATRTrailingStop[1], min(xATRTrailingStop[1], src + nLoss),
iff(src > xATRTrailingStop[1], src - nLoss, src + nLoss)));
pos = iff(src[1] < xATRTrailingStop[1] and src > xATRTrailingStop[1], 1,
iff(src[1] > xATRTrailingStop[1] and src < xATRTrailingStop[1], -1,pos[1]));
input : 기간(5);
var : Tema1(0),Tema2(0),Tema3(0),TemaM(0);
Tema1= EmA(close, 기간);
Tema2= EmA(Tema1, 기간);
Tema3= EmA(Tema2, 기간);
TemaM= 3 * Tema1 -3 * Tema2 + Tema3;
IF pos==1 && CROSSUP(TemaM,A1[2]) && CROSSUP(xATRTrailingStop,A1[2]) && C>O TheN
Find(1);
감사합니다. ^^
2023-11-24
1074
글번호 174314
검색
답변완료
수정 부탁드립니다.
안녕하세요?
아래 내용은 Data2의 지표입니다.
(Upvol-DownVol)를 Money-Money로 고쳤는데 안되네요..
내용 수식좀 봐주세요.
-------------------------------
input : R1(200),G1(0),B1(0);
input : R2(0),G2(0),B2(200);
var : V1(0,Data1),i1(0,Data1),h1(0,Data1),l1(0,Data1);
var : V2(0,Data2),i2(0,Data2),h2(0,Data2),l2(0,Data2);
if data1(Bdate != Bdate[1]) Then
{
v1 = data1(Money-Money);
i1 = data1(Money-Money);
h1 = v1;
l1 = v1;
}
Else
{
v1 = v1 + Data1(Money-Money);
if v1 > h1 Then
h1 = v1;
if v1 < l1 Then
l1 = v1;
}
if CurrentDate == sDate Then
{
Plot1(v1,"당일실매수금액",iff(v1 > 0,RGB(0,0,0),RGB(0,0,0)));
plot2(i1,"첫봉종가");
Plot3(h1,"최고");
plot4(l1,"최저");
plot5(l1+(h1-l1)*0.236,"23.6%");
plot6(l1+(h1-l1)*0.382,"38.2%");
plot7(l1+(h1-l1)*0.500,"50.0%");
plot8(l1+(h1-l1)*0.618,"61.8%");
plot9(l1+(h1-l1)*0.714,"71.4%");
PlotBaseLine1(0);
}
if data2(Bdate != Bdate[1]) Then
{
v2 = data2(Money-Money);
i2 = data2(Money-Money);
h2 = v2;
l2 = v2;
}
Else
{
v2 = v2 + Data2(Money-Money);
if v2 > h2 Then
h2 = v2;
if v2 < l2 Then
l2 = v2;
}
if CurrentDate == sDate Then
{
Plot11(v2,"당일실매수금액",iff(v1 > 0,RGB(0,0,0),RGB(0,0,0)));
plot12(i2,"첫봉종가");
Plot13(h2,"최고");
plot14(l2,"최저");
plot15(l2+(h2-l2)*0.236,"23.6%");
plot16(l2+(h2-l2)*0.382,"38.2%");
plot17(l2+(h2-l2)*0.500,"50.0%");
plot18(l2+(h2-l2)*0.618,"61.8%");
plot19(l2+(h2-l2)*0.714,"71.4%");
}
2023-11-24
1144
글번호 174312
지표
답변완료
수식 추가 부탁드려요
안녕하세요?
아래의 수식에서
1. 이동평균선을 2개(외부변수)
2. 이동평균선이 정배열이고, 캔들의 시가가 이동평균선보다 높을때 매수
3. 이동평균선이 역배열이고, 캔들의 시가가 이동평균선보다 낮을때 매도
이렇게 추가를 넣고싶습니다. 부탁드립니다.
input : P(20),매매횟수(3);
input : 익절틱수(10),손절틱수(10);
var : entry(0);
if Bdate != Bdate[1] Then
entry = 0;
if (MarketPosition != 0 and MarketPosition != MarketPosition[1]) or
(MarketPosition == MarketPosition[1] and TotalTrades > TotalTrades[1]) Then
entry = entry+1;
var1 = ma(C,P);
if O > var1 and entry < 매매횟수 Then
Buy();
SetStopProfittarget(PriceScale*익절틱수,PointStop);
SetStopLoss(PriceScale*손절틱수,PointStop)
2023-11-24
928
글번호 174311
시스템
답변완료
문의
Input: P10(10), HP(70), LP(30);
Var: V1(0), D1(0), AU(0), AD(0), XL(0), XH(0), RL(0), RH(0);
V1= C-C[1];
D1= C[1]-C;
AU= EMA( IFF(V1>0, V1, 0), 2*P10 -1);
AD= EMA( IFF(D1>0, D1, 0), 2*P10 -1);
XL= (P10-1)*( AD*LP/(100-LP) -AU);
RL= IFF(XL>=0, XL + C, C + XL*(100-LP)/LP);
XH= (P10-1)*( AD*HP/(100-HP) -AU);
RH= IFF(XH>=0, XH + c, C + XH*(100-HP)/HP);
plot1(RL, "RSI LP");
plot2(RH, "RSI HP");
데이타2로 변경부탁드립니다
2023-11-24
778
글번호 174309
지표
답변완료
문의드립니다.
수고 많으십니다.
국내선물로 미니 5계약 매매를 하는데 청산에서 잘 안되는 부분이 있어 문의드립니다.
1. 진입후 10틱 수익이면 1계약만 일단 부분 익절로 챙기고 나머지 계약수는 다른 청산식으로 청산대응을 하고 싶은데
문제는 1계약 익절후 그 다음 봉에서 또 익절을 하고 심지어 1개봉에서 2계약 익절도 나옵니다.
var : 익절틱수1(10);
if MarketPosition == 1 Then
ExitLong("B_P1",AtLimit,EntryPrice+PriceScale*익절틱수1,"",1,1);
이렇게도 해보고
if H < EntryPrice+PriceScale*익절틱수1 Then
ExitLong("B_P1",AtStop,EntryPrice+PriceScale*익절틱수1,"",1,1);
이렇게도 해보고
if MarketPosition == 1 Then
{
if CurrentContracts < CurrentContracts[1] Then
{
if LatestExitName(0) == "B_P1" Then
Condition1 = true;
}
if Condition1 == False and H < EntryPrice+PriceScale*익절틱수1 Then
ExitLong("B_P1"atstop,Var6-PriceScale*익절틱수1,"",1,1);
}
Else
{
Condition1 = False;
}
이렇게도 해봤으나 마찬가지입니다.
★ 다계약 진입후 "단 1번만" 진입가에서 위든 아래든 10틱 가면 익절하고 그뒤는 적용 안되는 청산식을 부탁드립니다 ★
=================================================================================================================
2. 트레이딩스탑도 마찬가지로 "단 1번씩만" 신호가 적용되고 그뒤 같은 조건이되도 적용안되게 부탁드립니다.
var : 최소수익1(20),수익감소1(10);
var : 최소수익2(30),수익감소2(20);
var : HH(0),LL(0);
if MarketPosition == 1 Then
{
HH = Highest(H,BarsSinceEntry);
if HH >= EntryPrice+PriceScale*최소수익1 and HH < EntryPrice+PriceScale*최소수익2 Then
ExitLong("B_TS1",AtStop,HH-PriceScale*수익감소1,"",2,1);
if HH >= EntryPrice+PriceScale*최소수익2 Then
ExitLong("B_TS2",AtStop,HH-PriceScale*수익감소2,"",1,1);
}
if MarketPosition == -1 Then
{
LL = lowest(L,BarsSinceEntry);
if LL <= EntryPrice-PriceScale*최소수익1 and LL > EntryPrice-PriceScale*최소수익2 Then
ExitShort("S_TS1",AtStop,LL+PriceScale*수익감소1,"",2,1);
if LL <= EntryPrice-PriceScale*최소수익2 Then
ExitShort("S_TS2",AtStop,LL+PriceScale*수익감소2,"",1,1);
}
노고에 늘 감사드립니다.
2023-11-26
737
글번호 174306
시스템
답변완료
수고많으십니다. 수식작성중 에러 검토 정중히 부탁드립니다.
수고 많으십니다.
/스팟 시작
function Main_OnStart()
{
Main.SetTimer(1, 10000);
exit3 = false;
}
function Main_OnTimer(nEventID)
{
if (nEventID == 1)
{
if (exit3 == false)
{
Account7.SetBalanceItem(MarketData1.code, 0);
var vo7 = Account7.Balance.count; //수량
var po7 = Account7.Balance.position; //포지션방향(매도1, 매수2)
var Cu7 = Account7.Balance.current; //현재가
var PL7 = Account7.Balance.profit;
var woo = C3.GetIndicatorData("진입1", 1, 0);
if (po7 == 1)
{
var woo1 = woo+0.001;
}
if (po7 == 2)
{
var woo1 = woo-0.001;
}
var tik = (woo1-Cu7)*10000;
var moksu = 40;
Main.MessageList("손익=",PL7,"na2=",woo,"청산=",woo1,"현재가=",Cu7,"포지션=",po7,"...틱수=",tik,"목수=",moksu);
}
}
if (po7 == 1 && Cu7 >=woo) or (PL7 >= moksu)
{
exit3 = true;
ID7 = Account7.OrderBuy(MarketData1.code,vo7, 0, 1);
}
if (po7 == 2 && Cu7 <= woo) or ( po7 == 2 && PL7 >= moksu)
{
ID7 = Account7.OrderSell(MarketData1.code,vo7,0, 1);
}
예스스팟 시험적용시 na2ez - ReferenceError: or is not defined 에러가 발생합니다.
if (po7 == 2 && Cu7 <= woo) || ( po7 == 2 && PL7 >= moksu)
이렇게 해도 에러가 납니다.
수식 검토 부탁드립니다.
감사합니다.
2023-11-23
949
글번호 174305
시스템