답변완료
식문의드립니다
안녕하세요 , 식문의드립니다.
이전 아래식 문의드렸는데
진입이 해당가격에 다았는데도 발생되지않고
봉이 몇번씩 해당가격을 지나간후 매수가 됩니다
해당가격에 다으면 바로 진입부탁드립니다
input : ndate(20201016),매수가1(1000),매수가2(900),매도가1(1100),매도가2(950), 손절가(800);
input : 매수수량1(50),매수수량2(80);
if sDate >= ndate Then
{
if MarketPosition == 0 and l > 매수가1 and TotalTrades == 0 Then
Buy("b1",AtLimit,매수가1,매수수량1);
if MarketPosition == 1 and MaxEntries == 1 Then
{
ExitLong("bp1",AtLimit,매도가1);
if l > 매수가2 Then
Buy("b2",AtLimit,매수가2,매수수량2);
}
if MarketPosition == 1 and MaxEntries == 2 Then
{
ExitLong("bp2",AtLimit,매도가2);
ExitLong("bl",AtStop,손절가);
}
}
2020-10-25
808
글번호 143377
시스템
답변완료
요청
data2 이용수식으로 변환바랍니다.
항상 고맙습니다.
*************************************************************************************
1)buy 수식
input : 이평(9),지지선(0.70),봉크기(0.30);
var : T(0),mav(0);
mav = ma(C,이평);
if bdate != bdate[1] Then
T = 0;
if t == 0 and H >= daylow+지지선 Then
T = 1;
if T == 1 and CrossDown(L,mav) Then
{
T = 2;
var1 = H;
if H-L >= 봉크기 Then
var2 = h;
Else
var2 = max(h,h[1]);
}
if T == 2 and L < var1-1 Then
T = 0;
if T == 2 and crossup(c,var2) Then
{
buy("b");
}
2) sell 수식
input : 이평(3),지지선(1.68),봉크기(0.16);
var : T(0),mav(0);
mav = ma(C,이평);
if bdate != bdate[1] Then
T = 0;
if t == 0 and L >= DayHigh-지지선 Then
T = 1;
if T == 1 and Crossup(H,mav) Then
{
T = 2;
var1 = H;
if H-L >= 봉크기 Then
var2 = l;
Else
var2 = max(l,l[1]);
}
if T == 2 and L < var1-1 Then
T = 0;
if T == 2 and CrossDown(c,var2) Then
{
sell("s");
}
2020-10-25
991
글번호 143376
시스템
답변완료
선 좀 부탁 드립니다.
* 좋은 하루 되십시요.
* 아래 수식에서 선 길이 좀 요청 드립니다......아래 처럼 했는데 출력이 안됨니다
1. 수평선길이는 다음봉 발생시 까지 수평선 유지
2. 수평선 간 최소 15틱 이상 발생시 출력
2. 이전 수평선은 3개 까지 만 출력
<아래 수식>
input: N(20);
var : TL01(0),TL02(0),TL03(0);
var11 = highest(H,N);
var12 = lowest(L,N);
var13 = (var11+var12) / 2 ;
## TL_Delete(TL03);
TL03 = TL_New(sDate,sTime,var13,NextBarSdate,NextBarStime,var13);
TL_SetExtLeft(TL03,true);
TL_SetExtRight(TL03,true);
TL_SetColor(TL03,BLACK);
TL_SetSize(TL03,2) ;
value11 = sdate;
value12 = stime;
value13 = l-0.01;
value41 = value11[1];
value51 = value12[1];
value61 = value13[1];
* 항상 많은 도움에 고맙습니다.
2020-10-25
921
글번호 143374
지표
답변완료
문의드립니다.
늘 초보들을 위해 힘 써 주셔서 감사합니다.
아래는 트레이딩뷰 지표인데 예스에 맞게 변환 부탁드립니다.
https://www.tradingview.com/script/OBOvLOxW-QuantNomad-Heikin-Ashi-PSAR-Alerts/
// INPUTS //
start = input(0.02, title = "PSAR Start")
increment = input(0.02, title = "PSAR Increment")
maximum = input(0.2, title = "PSAR Max")
// Calculation HA Values
haopen = 0.0
haclose = (open + high + low + close) / 4
haopen := na(haopen[1]) ? (open + close) / 2 : (haopen[1] + haclose[1]) / 2
hahigh = max(high, max(haopen, haclose))
halow = min(low, min(haopen, haclose))
// HA colors
hacolor = haclose > haopen ? color.green : color.red
psar = 0.0 // PSAR
af = 0.0 // Acceleration Factor
trend_dir = 0 // Current direction of PSAR
ep = 0.0 // Extreme point
trend_bars = 0
sar_long_to_short = trend_dir[1] == 1 and haclose <= psar[1] // PSAR switches from long to short
sar_short_to_long = trend_dir[1] == -1 and haclose >= psar[1] // PSAR switches from short to long
trend_change = na(psar[2]) or sar_long_to_short or sar_short_to_long
// Calculate trend direction
trend_dir := na(psar[2]) and haclose[1] > haopen[1] ? 1 :
na(psar[2]) and haclose[1] <= haopen[1] ? -1 :
sar_long_to_short ? -1 :
sar_short_to_long ? 1 : nz(trend_dir[1])
trend_bars := sar_long_to_short ? -1 :
sar_short_to_long ? 1 :
trend_dir == 1 ? nz(trend_bars[1]) + 1 :
trend_dir == -1 ? nz(trend_bars[1]) - 1 :
nz(trend_bars[1])
// Calculate Acceleration Factor
af := trend_change ? start :
(trend_dir == 1 and hahigh > ep[1]) or
(trend_dir == -1 and low < ep[1]) ?
min(maximum, af[1] + increment) :
af[1]
// Calculate extreme point
ep := trend_change and trend_dir == 1 ? hahigh :
trend_change and trend_dir == -1 ? halow :
trend_dir == 1 ? max(ep[1], hahigh) :
min(ep[1], halow)
// Calculate PSAR
psar := na(psar[2]) and haclose[1] > haopen[1] ? halow[1] :
na(psar[2]) and haclose[1] <= haopen[1] ? hahigh[1] :
trend_change ? ep[1] :
trend_dir == 1 ? psar[1] + af * (ep - psar[1]) : psar[1] - af * (psar[1] - ep)
plotcandle(haopen, hahigh, halow, haclose, title = "HA", color = hacolor)
plot(psar, style=plot.style_cross, color=trend_dir == 1 ? color.green : color.red, linewidth = 2)
plotshape(sar_short_to_long, color = color.green, style = shape.arrowup, text = "Long", location = location.abovebar)
plotshape(sar_long_to_short, color = color.red, style = shape.arrowdown, text = "Short", location = location.belowbar)
alertcondition(sar_short_to_long, "HA PSAR Long", "HA PSAR Long")
alertcondition(sar_long_to_short, "HA PSAR Short", "HA Short Long")
2020-10-25
1043
글번호 143373
지표