답변완료
전일 시스템 수정 좀 요청 드림니다.
* 항상 큰 도움에 고맙 습니다.
* 전일 작성 수식중 추가 수정 좀 요청 드리겠습니다.
ㅇ요청 사항: 사진1에 보면 최대 손실이 -5.7 나오는데
진입후 손실이 -50틱 이상 이면 추가진입 5차 까지 수식 좀 수정 요청 드립니다.
ㅇ즉 최초 1계약 -50틱 이하 (색상무시) 이면 2차 추가 진입 2계약
2차 진입후 또 -50틱(2차 진입가 기준) 이면 3차 추가 진입 4계약
3차 진입후 또 -50틱(3차진입가 기준) 이면 4차 추가 진입 8계약
4차 진입후 또 -50틱(4차진입가 기준) 이면 5차 추가 진입 16계약
끝
으로 수정 좀 요청 드림니다. 죄송합니다.
##
input : len(20),len2(20);
var : oo(0),cc(0),hh(0),ll(0),col(0);
var : haclose(0),haopen(0),hahigh(0),halow(0);
var : o2(0),h2(0),l2(0),c2(0);
oo=ema(open,len);
cc=ema(close,len);
hh=ema(high,len);
ll=ema(low,len);
haclose = (oo+hh+ll+cc)/4;
haopen = iff(IsNaN(haopen[1]) == true, (oo + cc)/2 , (haopen[1] + haclose[1]) / 2);
hahigh = max (hh, max(haopen,haclose));
halow = min (ll, min(haopen,haclose));
o2=ema(haopen, len2);
c2=ema(haclose, len2);
h2=ema(hahigh, len2);
l2=ema(halow, len2);
col=iff(o2>c2 , red , lime);
##============================================================================================================
##============================================================================================================
input : StartTime(080000),EndTime(220000);
var : Tcond(False);
IF Endtime > starttime Then
SetStopEndofday(Endtime);
Else
{
if sDate != sDate[1] Then
SetStopEndofday(Endtime);
}
if (sdate != sdate[1] and stime >= EndTime) or
(sdate == sdate[1] and stime >= EndTime and stime[1] < EndTime) Then
Tcond = False;
if (sdate != sdate[1] and stime >= StartTime) or
(sdate == sdate[1] and stime >= StartTime and stime[1] < StartTime) Then
{
Tcond = true;
IF Endtime <= starttime Then
{
SetStopEndofday(0);
}
}
##============================================================================================================
Input : Period(60);
var : TSF(0),vol(0);
TSF = LRL(C,Period)+LRS(C,Period);
##============================================================================================================
{
##============================================================================================================
## 매수식
If MarketPosition >= 0 and sDate >= 20230101 and Tcond == true and stime >= 072000 and stime <= 220000 and CrossUp(TSF, TSF[8]) Then
{
Buy( "수");
PlaySound("C:KiwoomGlobalsoundsound1.wav");
}
##============================================================================================================
##============================================================================================================
## 매도식
If MarketPosition <= 0 and sDate >= 20230101 and Tcond == true and stime >= 072000 and stime <= 220000 and CrossDown(TSF, TSF[8]) Then
{
Sell( "도");
PlaySound("C:KiwoomGlobalsoundsound1.wav");
}
##============================================================================================================
##============================================================================================================
}
##============================================================================================================
##============================================================================================================
## 매수 청산식
if MarketPosition == 1 then
{
if CurrentContracts > CurrentContracts[1] Then
{
if MaxEntries == 1 Then
vol = 1;
Else
vol = CurrentContracts-CurrentContracts[1];
}
if col != col[1] and MaxEntries < 5 and C <= EntryPrice-PriceScale*50 Then
Buy("bb",OnClose,Def,vol*2);
if MaxEntries == 1 Then
ExitLong("수수익1",AtLimit,avgEntryPrice+PriceScale*35);
Else
ExitLong("수수익2",AtLimit,avgEntryPrice+(PriceScale*50)/CurrentContracts);
}
##============================================================================================================
##============================================================================================================
## 매도 청산식
if MarketPosition == -1 then
{
if CurrentContracts > CurrentContracts[1] Then
{
if MaxEntries == 1 Then
vol = 1;
Else
vol = CurrentContracts-CurrentContracts[1];
}
if col != col[1] and MaxEntries < 5 and C >= EntryPrice+PriceScale*50 Then
Sell("ss",OnClose,Def,vol*2);
if MaxEntries == 1 Then
ExitShort("도수익1",AtLimit,avgEntryPrice-PriceScale*35);
Else
ExitShort("도수익2",AtLimit,avgEntryPrice-(PriceScale*50)/CurrentContracts);
}
##============================================================================================================
##============================================================================================================
SetStopEndofday(230000);
##============================================================================================================
##============================================================================================================
2025-03-12
277
글번호 189071
시스템
답변완료
검색식 부탁 드립니다
avg((highest(high,기간)),기간)
지표조건
기간 240
1.분봉 돌파 검색식 부탁 드립니다
A=(C- lowest(C, period))/C*100;// GOLDENPOWER 지표
GB=max(A, 0);
B=(highest(C, period) -C)/C*100;
GS=max(B, 0);
BB=(C-lowest(L,Period))/(highest(H,Period)-lowest(L,Period))*100; // 스토F 지표
SS=Sum(C-lowest(L,기간1),기간2) //스토 슬루우 지표
/Sum((highest(H,기간1)-lowest(L,기간1)),기간2)* 100; //스토케스틱 슬로우 본선
AA=eavg(SS, 기간3); //스토케스틱 시그널선
D=CROSSUP(GB,GS) && CROSSUP(BB,50) && SS>AA && V>MA(V,period)*배수;
valuewhen(1,D,C)
지표조건
period 14
기간1 12
기간2 5
기간3
배수 1
2. 분봉상 첫번째돌파 검색식 부탁 드립니다 첫번째만 검색 돌도록 부탁 드립니다
2025-03-12
226
글번호 189069
종목검색
답변완료
수식 변환
안녕하세요.
하기 키움수식을 예스랭귀로 변환 요청드립니다.
감사합니다.
RWL = max( (H(1)-LOW ) / ( (ref( sum( atr(1), 2), 1) / 2) * sqrt(2) ),
( H(2)-LOW ) / ( (ref( sum( atr(1), 3), 1) / 3) * sqrt(3) ),
( H(3)-LOW ) / ( (ref( sum( atr(1), 4), 1) / 4) * sqrt(4) ),
( H(4)-LOW ) / ( (ref( sum( atr(1), 5), 1) / 5) * sqrt(5) ),
( H(5)-LOW ) / ( (ref( sum( atr(1), 6), 1) / 6) * sqrt(6) ),
( H(6)-LOW ) / ( (ref( sum( atr(1), 7), 1) / 7) * sqrt(7) ),
( H(7)-LOW ) / ( (ref( sum( atr(1), 8), 1) / 8) * sqrt(8) ),
( H(8)-LOW ) / ( (ref( sum( atr(1), 9), 1) / 9) * sqrt(9) ) );
RWL
RWH = max( (H-LOW(1) ) / ( (ref( sum( atr(1), 2), 1) / 2) * sqrt(2) ),
( H-LOW(2) ) / ( (ref( sum( atr(1), 3), 1) / 3) * sqrt(3) ),
( H-LOW(3) ) / ( (ref( sum( atr(1), 4), 1) / 4) * sqrt(4) ),
( H-LOW(4) ) / ( (ref( sum( atr(1), 5), 1) / 5) * sqrt(5) ),
( H-LOW(5) ) / ( (ref( sum( atr(1), 6), 1) / 6) * sqrt(6) ),
( H-LOW(6) ) / ( (ref( sum( atr(1), 7), 1) / 7) * sqrt(7) ),
( H-LOW(7) ) / ( (ref( sum( atr(1), 8), 1) / 8) * sqrt(8) ),
( H-LOW(8) ) / ( (ref( sum( atr(1), 9), 1) / 9) * sqrt(9) ) );
RWH
2025-03-12
292
글번호 189068
지표
답변완료
수식변환 부탁드립니다.
안녕하세요
// This work is licensed under a Attribution-NonCommercial-ShareAlike 4.0 International (CC BY-NC-SA 4.0) https://creativecommons.org/licenses/by-nc-sa/4.0/
// © LuxAlgo
//@version=5
indicator("Nadaraya-Watson Envelope [LuxAlgo]", "LuxAlgo - Nadaraya-Watson Envelope", overlay = true, max_lines_count = 500, max_labels_count = 500, max_bars_back=500)
//------------------------------------------------------------------------------
//Settings
//-----------------------------------------------------------------------------{
h = input.float(8.,'Bandwidth', minval = 0)
mult = input.float(3., minval = 0)
src = input(close, 'Source')
repaint = input(true, 'Repainting Smoothing', tooltip = 'Repainting is an effect where the indicators historical output is subject to change over time. Disabling repainting will cause the indicator to output the endpoints of the calculations')
//Style
upCss = input.color(color.teal, 'Colors', inline = 'inline1', group = 'Style')
dnCss = input.color(color.red, '', inline = 'inline1', group = 'Style')
//-----------------------------------------------------------------------------}
//Functions
//-----------------------------------------------------------------------------{
//Gaussian window
gauss(x, h) => math.exp(-(math.pow(x, 2)/(h * h * 2)))
//-----------------------------------------------------------------------------}
//Append lines
//-----------------------------------------------------------------------------{
n = bar_index
var ln = array.new_line(0)
if barstate.isfirst and repaint
for i = 0 to 499
array.push(ln,line.new(na,na,na,na))
//-----------------------------------------------------------------------------}
//End point method
//-----------------------------------------------------------------------------{
var coefs = array.new_float(0)
var den = 0.
if barstate.isfirst and not repaint
for i = 0 to 499
w = gauss(i, h)
coefs.push(w)
den := coefs.sum()
out = 0.
if not repaint
for i = 0 to 499
out += src[i] * coefs.get(i)
out /= den
mae = ta.sma(math.abs(src - out), 499) * mult
upper = out + mae
lower = out - mae
//-----------------------------------------------------------------------------}
//Compute and display NWE
//-----------------------------------------------------------------------------{
float y2 = na
float y1 = na
nwe = array.new<float>(0)
if barstate.islast and repaint
sae = 0.
//Compute and set NWE point
for i = 0 to math.min(499,n - 1)
sum = 0.
sumw = 0.
//Compute weighted mean
for j = 0 to math.min(499,n - 1)
w = gauss(i - j, h)
sum += src[j] * w
sumw += w
y2 := sum / sumw
sae += math.abs(src[i] - y2)
nwe.push(y2)
sae := sae / math.min(499,n - 1) * mult
for i = 0 to math.min(499,n - 1)
if i%2
line.new(n-i+1, y1 + sae, n-i, nwe.get(i) + sae, color = upCss)
line.new(n-i+1, y1 - sae, n-i, nwe.get(i) - sae, color = dnCss)
if src[i] > nwe.get(i) + sae and src[i+1] < nwe.get(i) + sae
label.new(n-i, src[i], '▼', color = color(na), style = label.style_label_down, textcolor = dnCss, textalign = text.align_center)
if src[i] < nwe.get(i) - sae and src[i+1] > nwe.get(i) - sae
label.new(n-i, src[i], '▲', color = color(na), style = label.style_label_up, textcolor = upCss, textalign = text.align_center)
y1 := nwe.get(i)
//-----------------------------------------------------------------------------}
//Dashboard
//-----------------------------------------------------------------------------{
var tb = table.new(position.top_right, 1, 1
, bgcolor = #1e222d
, border_color = #373a46
, border_width = 1
, frame_color = #373a46
, frame_width = 1)
if repaint
tb.cell(0, 0, 'Repainting Mode Enabled', text_color = color.white, text_size = size.small)
//-----------------------------------------------------------------------------}
//Plot
//-----------------------------------------------------------------------------}
plot(repaint ? na : out + mae, 'Upper', upCss)
plot(repaint ? na : out - mae, 'Lower', dnCss)
//Crossing Arrows
plotshape(ta.crossunder(close, out - mae) ? low : na, "Crossunder", shape.labelup, location.absolute, color(na), 0 , text = '▲', textcolor = upCss, size = size.tiny)
plotshape(ta.crossover(close, out + mae) ? high : na, "Crossover", shape.labeldown, location.absolute, color(na), 0 , text = '▼', textcolor = dnCss, size = size.tiny)
//-----------------------------------------------------------------------------}
2025-03-12
378
글번호 189065
지표
답변완료
함수요청
안녕하세요?
아래 스크립트에서 매수신호는 매도신호를 매도신호는 매수신호를
매수청산신호는 매도청산신호를 매도청산신호는 매수청산신호가 생성되도록 신호를 거꾸로 나오게 해주세요
input : n(5);
input : cc(5), sm(4), lm(11);
var1 = ma(c,cc);
var2 = ma(c,sm);
var3 = ma(c,lm);
Condition1 = var1 < Var3 and Var2 > Var3;
Condition2 = var1 > Var3 and Var2 < var3;
if NextBarSdate != sDate Then
{
if DayClose(1) < DayOpen(1) and DayClose(0) > DayOpen(0) Then
{
if max(DayClose(1),DayOpen(1)) > max(DayClose(0),DayOpen(0)) and
min(DayClose(1),DayOpen(1)) < min(DayClose(0),DayOpen(0)) and
condition2 == true
Then
Buy("b1",AtMarket);
if max(DayClose(1),DayOpen(1)) < max(DayClose(0),DayOpen(0)) and
min(DayClose(1),DayOpen(1)) > min(DayClose(0),DayOpen(0)) and
condition2 == true then
Buy("b2",AtMarket);
}
if DayClose(1) > DayOpen(1) and DayClose(0) < DayOpen(0) Then
{
if max(DayClose(1),DayOpen(1)) > max(DayClose(0),DayOpen(0)) and
min(DayClose(1),DayOpen(1)) < min(DayClose(0),DayOpen(0)) and
condition1 == true Then
Sell("s1",AtMarket);
if max(DayClose(1),DayOpen(1)) < max(DayClose(0),DayOpen(0)) and
min(DayClose(1),DayOpen(1)) > min(DayClose(0),DayOpen(0))and
condition1 == true Then
Sell("s2",AtMarket);
}
}
if MarketPosition == 1 Then
{
if IsEntryName("b1",0) == true and BarsSinceEntry == n Then
{
if NextBarOpen >= EntryPrice Then
ExitLong("bx1",AtMarket);
Else
Sell("s3",AtMarket);
}
if IsEntryName("b2",0) == true and BarsSinceEntry == n Then
{
if NextBarOpen >= EntryPrice Then
ExitLong("bx2",AtMarket);
Else
Sell("s4",AtMarket);
}
if IsEntryName("b3",0) == true and BarsSinceEntry == n Then
{
ExitLong("bx3",AtMarket);
}
if IsEntryName("b4",0) == true and BarsSinceEntry == n Then
{
ExitLong("bx4",AtMarket);
}
}
if MarketPosition == -1 Then
{
if IsEntryName("s1",0) == true and BarsSinceEntry == n Then
{
if NextBarOpen <= EntryPrice Then
ExitShort("sx1",AtMarket);
Else
Buy("b3",AtMarket);
}
if IsEntryName("s2",0) == true and BarsSinceEntry == n Then
{
if NextBarOpen <= EntryPrice Then
ExitShort("sx2",AtMarket);
Else
Buy("b4",AtMarket);
}
if IsEntryName("s3",0) == true and BarsSinceEntry == Then
{
ExitShort("sx3",AtMarket);
}
if IsEntryName("s4",0) == true and BarsSinceEntry == n Then
{
ExitShort("sx4",AtMarket);
}
}
2025-03-11
264
글번호 189060
시스템