답변완료
검색식 부탁드립니다. _(_ _)_
도와주심에 감사드립니다. _(__)_
1봉전 30봉이내에서 1수식을 만족시키는 봉이 출현하고 0봉전에서 각각 2수식과 3수식을
만족시키는 종목 검색식을 부탁드립니다.
두가지 검색식이 되겠습니다. 1수식과 2수식조건, 1수식과 3수식조건
1수식
var : m5(0),m20(0),크로스업(False),hh(0),H_high(0),ll(0),L_sum(0),ls(0),조건(false),cnt(-1);
M5 = ma(c,5);
M20 = ma(c,20);
크로스업 = crossup(M5,M20);
if 크로스업 == true Then
{
hh = h;
var1 = L_sum[1];
cnt = 0;
}
Else
{
if hh > 0 and h > hh Then
hh = h;
}
if HH==HH[1] && HH > H Then
H_high = HH;
LL = iff(M20>L, 1, 0);
L_sum = Accum(LL);
Ls = L_sum-var1;
조건 = CrossUp(c, H_High) && Ls>0;
if 조건 == true Then
{
if cnt >= 0 Then
{
cnt = cnt+1;
if cnt == 1 Then
Find(1);
}
}
2수식
var : Month(0), MOpen(0), 중심(0),PreMC(0), PreMO(0);
Month = Floor(date/100);
if Month != Month[1] Then {
PreMC = C[1];
PreMO = MOpen;
MOpen = O ;
}
중심 = ((PreMC + PreMO)/2 + MOpen)/2;
if CrossUp(C, 중심) Then Find(1);
3수식은 엔벨로프(20,10)지지선이탈후 0봉전 재돌파
2024-06-19
774
글번호 180764
종목검색
답변완료
문의 드립니다.
아래 파인스크립트 지표를 예스로 변환 했는데 값이 다르게 나오는데 왜 그런지 모르겠네요.
혹시 체크해 보시고 잘못 변환한 부분이 있는지 체크 부탁드립니다.
plot만 구현하고 히스토그램등 필요없는건 뺐습니다.
//@version=5
// Original concept by David Bostian, with variations featured in "Bollinger on Bollinger Bands".
indicator("Intraday Intensity Modes", 'Intensity')
toolTipA = 'III (Individual):₩nOsc Length 1₩n[ ] Cumulative (Off)₩n[ ] Normalized (Off)₩n[ ] Inverse Volu' +
'me (Off)₩n[ ] Show Levels (Off)₩n₩n'
toolTipB = 'II (Cumulative):₩nOsc Length 1₩n[✓] Cumulative (On)₩n[ ] Normalized (Off)₩n[ ] Inverse Volume ' +
'(Off)₩n[ ] Show Levels (Off)₩n₩n'
toolTipC = 'II% (Oscillator):₩nOsc Length 21₩n[ ] Cumulative (Off)₩n[✓] Normalized (On)₩n[ ] Inverse Volume' +
' (Off)₩n[✓] Show Levels (On)'
toolTipD = 'Enables examination of intensity per bar instead of per day, this is a departure from the original ' +
'concept. Whenever this setting is enabled the indicator should be regarded as operating in an experimental mode.'
toolTipV = '[ ] Inverse Volume (Off):₩n₩n (2 * close - high - low) * volume₩n ────────────────₩n ' +
' high - low₩n₩n₩n[✓] Inverse Volume (On):₩n₩n 2 * close - high - low₩n ───────────' +
'₩n (high - low) * volume'
i_length = input.int (21, 'Osc Length', minval = 1, tooltip = toolTipA + toolTipB + toolTipC)
i_cumltv = input.bool (false, 'Cumulative')
i_normal = input.bool (true, 'Normalized')
i_candle = input.bool (false, 'Intrabar', tooltip = toolTipD)
i_invert = input.bool (false, 'Inverse Volume', tooltip = toolTipV)
i_colrUp = input.color(#00BCD4, 'Colors For Up', inline = 'a')
i_colrDn = input.color(#E040FB, 'Down', inline = 'a')
i_styles = input.string('Columns', 'Style & Width', options = ['Columns', 'Histogram', 'Line'], inline = 'b')
i_widths = input.int (1, '', minval = 1, inline = 'b')
i_shoLvl = input.bool (true, '', inline = 'c')
i_levelH = input.int (25, 'Show Levels Above', inline = 'c')
i_levelL = input.int (-25, 'Below', inline = 'c')
id_cum(source) => // perform cumulative sum once per day when using realtime intraday source values
var carrySum = float(na)
var dailySum = float(na)
if not timeframe.isintraday
carrySum := ta.cum(nz(source))
else
dailySum := timeframe.change('D') ? nz(carrySum) : nz(dailySum)
carrySum := nz(dailySum) + nz(source)
altSum(source, length) => normal = math.sum(nz(source), length) // treat na as 0 and return sum
var idRangeH = float(na)
var idRangeL = float(na)
var idVolume = float(na)
startDay = timeframe.change('D')
idRangeH := not timeframe.isintraday or startDay ? high : high > nz(idRangeH) ? high : idRangeH // intraday high
idRangeL := not timeframe.isintraday or startDay ? low : low < nz(idRangeL, 10e99) ? low : idRangeL // intraday low
idVolume := not timeframe.isintraday or startDay ? volume : nz(idVolume) + volume // intraday volume
idUseVol = i_invert ? 1 / idVolume : idVolume
iiiValue = nz(((2 * close - idRangeH - idRangeL) / (idRangeH - idRangeL)) * idUseVol) // intraday intensity
use_iii = i_invert ?
(2 * close - high - low) / ((high - low) * volume) :
((2 * close - high - low) / (high - low)) * volume
usePrcnt = i_normal ? 100 : 1
iiSource =
usePrcnt * altSum(i_cumltv ? i_candle ? ta.cum(nz(use_iii)) : id_cum(iiiValue) : i_candle ? nz(use_iii) : iiiValue, i_length) /
(i_normal ? altSum(i_cumltv ? i_candle ? ta.cum(volume) : id_cum(idVolume) : i_candle ? volume : idVolume, i_length) : 1)
colrSign = altSum(i_candle ? use_iii : iiiValue, i_length) / (i_normal ? i_candle ? volume : altSum(idVolume, i_length) : 1)
pltStyle = i_styles == 'Columns' ? plot.style_columns : i_styles == 'Histogram' ? plot.style_histogram : plot.style_line
plot(iiSource, 'III, II, or II%', math.sign(colrSign) != -1 ? i_colrUp : i_colrDn, i_widths, pltStyle)
plot(startDay ? 1 : 0, 'startDay', #ffff00, display = display.data_window)
plot(close, 'close', #ffff00, display = display.data_window)
plot(high, 'high', #ffff00, display = display.data_window)
plot(low, 'low', #ffff00, display = display.data_window)
plot(volume, 'volume', #ffff00, display = display.data_window)
plot(idRangeH, 'idRangeH', #ffff00, display = display.data_window)
plot(idRangeL, 'idRangeL', #ffff00, display = display.data_window)
plot(idVolume, 'idVolume', #ffff00, display = display.data_window)
plot(iiiValue, 'iiiValue', #ffff00, display = display.data_window)
plot(iiSource, 'iiSource', #ffff00, display = display.data_window)
hline(i_shoLvl ? i_levelH : na)
hline(i_shoLvl ? i_levelL : na)
변환
Input: OscLength(21);
Input: Cumulative(False);
Input: Normalized(True);
Input: Intrabar(False);
Input: InverseVolume(False);
Input: UpColor(Blue), DownColor(Red);
Input: Width(1);
Input: ShowLevels(True);
Input: LevelHigh(25), LevelLow(-25);
Vars: CarrySum(0), DailySum(0), StartDay(False);
Vars: IDRangeH(0), IDRangeL(0), IDVolume(0), IDUseVol(0), IIIValue(0);
Vars: UseIII(0), UsePrcnt(1), IISource(0), ColrSign(0);
Vars: LineColor(Blue);
Vars: i(0), SumCarrySum(0), SumIDVolume(0), SumDailySum(0);
// 데이터 초기화
if Date <> Date[1] then begin
StartDay = True;
CarrySum = 0;
DailySum = 0;
IDRangeH = High;
IDRangeL = Low;
IDVolume = Volume;
end
else begin
StartDay = False;
IDRangeH = MaxList(IDRangeH, High);
IDRangeL = MinList(IDRangeL, Low);
IDVolume = IDVolume + Volume;
end;
// IDUseVol 값 설정
if InverseVolume then
IDUseVol = 1 / IDVolume;
else
IDUseVol = IDVolume;
IIIValue = ((2 * Close - IDRangeH - IDRangeL) / (IDRangeH - IDRangeL)) * IDUseVol;
if Cumulative then begin
CarrySum = CarrySum + IIIValue;
DailySum = CarrySum;
end
else begin
DailySum = IIIValue;
end;
UseIII = DailySum;
// 데이터 합산 변수 초기화
SumCarrySum = 0;
SumIDVolume = 0;
SumDailySum = 0;
// 데이터 합산 루프
for i = 0 to OscLength - 1 begin
SumCarrySum = SumCarrySum + IIIValue[i];
SumIDVolume = SumIDVolume + IDVolume[i];
SumDailySum = SumDailySum + DailySum[i];
end;
// 데이터 스케일 조정 및 백분율 변환
if Cumulative then begin
IISource = 100 * (SumCarrySum / SumIDVolume);
end
else begin
IISource = 100 * (SumDailySum / SumIDVolume);
end;
// ColrSign 계산
if Normalized then
ColrSign = 100 * (SumDailySum / SumIDVolume);
else
ColrSign = SumDailySum / SumIDVolume;
// LineColor 설정
if ColrSign >= 0 then
LineColor = UpColor;
else
LineColor = DownColor;
Plot1(IISource, "III, II, or II%", LineColor, Width);
if ShowLevels then begin
Plot2(LevelHigh, "LevelHigh");
Plot3(LevelLow, "LevelLow");
end;
2024-06-19
805
글번호 180760
지표
답변완료
검색식 부탁 드립니다
Input : lengthMA(34),lengthSignal(9);
var :src(0),hi(0),lo(0),Ema1(0),Ema2(0),mi(0);
var:md(0),sb(0),sh(0),mdc(0);
src= (h+l+c)/3;
hi= iff(IsNan(hi[1]) == true, ma(high,lengthMA), hi[1]* (lengthMA-1)+high)/lengthMA;
lo = iff(IsNan(lo[1]) == true, ma(low,lengthMA), lo[1]*(lengthMA-1)+low)/lengthMA;
Ema1=ema(src,lengthMA);
Ema2= ema(Ema1,lengthMA);
mi=Ema1+(Ema1-ema2);
md=iff((mi>hi),(mi-hi),IFf((mi<lo),(mi-lo),0));
sb = ma(md, lengthSignal);
sh= md-sb;
mdc = iff(src>mi,iff(src>hi,lime,green),iff(src<lo,red,orange));
plot1(0,"MidLine",Gray);
plot2(md,"ImpulseMACD",mdc);#속성에서 막대
plot3(sh,"ImpulseHisto",Blue); #속성에서 막대
plot4(sb,"ImpulseMACDCDSignal", Maroon);
종목 검색식 부탁 드립니다
60_이격도 기준선
A= Disparity(Period2);
ValueWhen(1, crossup(A, 기준2) OR crossdown(A, 기준2) ,가격)
지표존건
period2 60
기준2 101
가격 (고가+저가)/2
지표값 수치가 10%상승 한 종목 검색식 부탁드립니다
2024-06-19
780
글번호 180759
종목검색