답변완료
당일청산
수고하십니다. 다음 내용 시스템 수식 부탁드립니다. 1. 기본 가. 사용자개발지수 : '상방', '하방' 나. 당일청산, 따라서 개장시 포지션 없슴. 다. 조건 만족시(봉 완성시) 현재가 보다 a틱(변수, 최적화할 예정) 만큼 유리하게 진입. 즉, 매수조건이면 a틱만큼 낮게, 매도조건이면 a틱 만큼 높게 진입 라. 첫 거래 이후 청산조건에 이르면 청산과 동시에 반대포지션 진입 마. 첫 진입은 개장 후 000000(변수, 최적화할 예정, 기본값25분) 시간 경과하거나, 또는 정해진 시간(변수, 최적화할 예정, 기본값 09시10분 이후) 이후 진입 바. 2회에 걸쳐 물타기 사. 당일 청산, 시간은 000000(변수, 최적화할 예정,기본값, 3시20분) 2. 최초 진입 가. 최초 진입 (이 때 포시션은 0인 상태) 정해진 시간 경과 후, '상방' >'하방' 이면 매수 1계약 진입, 반대면 매도 한 계약 진입 나. 물타기 1) 기본 조건 : 최초 진입할 때 조건이 유지되어야 한다. 즉, 매수 1계약 상태이면 '상방'>'하방'이 유지되어야 하고, 매도 1계약 상태이면 '상방' < '하방'이 유지되고 있어야 한다. 2) 1차 물타기 : 반대로 00틱 (변수, 최적화 예정) 가면 1계약 추가 (위 1)의 기본 조건 충족하고 있어야 한다) 3) 2차 물타기 : 평단에서 00틱 (변수, 최적화 예정) 가면 1계약 추가 (위 1)의 기본 조건 충족하고 있어야 한다) 다. 포지션 청산 1) 물타기 되어 복수의 수량을 보유하고 있어도 분할 청산 없슴. 2) 손절 매수 조건('상방'>'하방')이어서 진입하였으나 매도 조건('상방'<'하방')으로 바뀌면 포지션 해당봉의 종가로 전부 손절. 즉, '상방'이 '하방'과 데드크로스하면 손절. 매도는 반대 3)본절 평단(1계약일때는 진입가) 대비 00틱(변수, 최적화 예정) 이익이 나다가 진입가(또는 평단) 오면 본절청산 4) 익절 가) 기본 트레일링 스탑 . 집입 후 00틱(변수, 최적화 예정) 이익이 나다 00틱 (변수, 최적화 예정) 줄어들면 청산. 나) 트레일링스탑으로 청산되지 않은 포지션 당일청산 조건으로 청산, 이후 무포지션 3. 두번째부터 진입 기존 포지션 손절과 동시에 반대편 포지션 진입하고 이후 물타기 및 청산 조건은 최초진입과 동일
2025-10-26
106
글번호 227310
시스템
답변완료
수식 부탁드립니다
지표식 부탁 드립니다. //@version=5indicator('DFT', overlay=true)import jdehorty/KernelFunctions/2 as kernel// INPUTSN = input.int(10,"Fourier Period")xval = input.source(close,"Fourier X Series",tooltip = "i.e. the source of the discrete Fourier"+ " transform (with the Y Series being the bars through time.)")highlighting = input.bool(true,"Highlighting")smoothing = input.int(10,"Kernel Smoothing")DFT(x, y, Nx, _dir) => float _arg = 0.0 float _cos = 0.0 float _sin = 0.0 float xArr_i = 0.0 float yArr_i = 0.0 xArr = array.new_float(array.size(x)) yArr = array.new_float(array.size(y)) for i = 0 to Nx - 1 by 1 xArr_i := 0.0 yArr_i := 0.0 kx = float(i) / float(Nx) _arg := -_dir * 2 * math.pi * kx for k = 0 to Nx - 1 by 1 _cos := math.cos(k * _arg) _sin := math.sin(k * _arg) xArr_i += array.get(x, k) * _cos - array.get(y, k) * _sin yArr_i += array.get(x, k) * _sin + array.get(y, k) * _cos yArr_i array.set(xArr, i, xArr_i) array.set(yArr, i, yArr_i) if _dir == 1 for i = 0 to Nx - 1 by 1 array.set(x, i, array.get(xArr, i) / float(Nx)) array.set(y, i, array.get(yArr, i) / float(Nx)) else for i = 0 to Nx - 1 by 1 array.set(x, i, array.get(xArr, i)) array.set(y, i, array.get(yArr, i))// CALCULATIONS// Fourier transformx = array.new_float(N, 0.0)y = array.new_float(N, 0.0)for i = 0 to N - 1 array.set(x, i, xval[i]) array.set(y, i, 0.0)DFT(x, y, N, 1)mag = array.new_float(N, 0.0)for i = 0 to N - 1 mag_i = math.sqrt(math.pow(array.get(x, i), 2) + math.pow(array.get(y, i), 2)) array.set(mag, i, mag_i)dft = array.get(mag,0)dfts = kernel.rationalQuadratic(dft,25,1,smoothing)// DISPLAYft = plot(dft, "DFT", color= color.white)fts = plot(dfts, "Smoothing", color = dfts > dft ? color.red : color.lime)fill(ft,fts,color = highlighting and dfts > dft ? color.new(color.red,75) : highlighting and dfts < dft ? color.new(color.lime,75) : na)
2025-10-25
196
글번호 227298
지표
답변완료
부탁드립니다
수고하십니다아래수식을 오류 없게 수정부탁드립니다Inputs: PivotLength(10), TrendLength(50), ShowProfile(true), ColorUp(Blue), ColorDn(Red);Variables: PH(0), PL(0), HighestH(0), LowestL(0), TrendLine(0), ATRValue(0), IsTrendUp(false), PivotDetected(false), StartBar(0), TopPrice(0), BotPrice(0), Levels(0), StepSize(0), i(0), k(0), MidPrice(0), POCPrice(0), POCVolume(0), CurrentColor(0);Arrays: VolumeBins[1000](0);// ATR 계산ATRValue = Average(TrueRange, 200) * 0.1;// Pivot 감지PH = 0;PL = 0;// Pivot High 감지if High[PivotLength] = Highest(High, 2 * PivotLength + 1) then PH = High[PivotLength];// Pivot Low 감지if Low[PivotLength] = Lowest(Low, 2 * PivotLength + 1) then PL = Low[PivotLength];// 트렌드 계산HighestH = Highest(High, TrendLength);LowestL = Lowest(Low, TrendLength);TrendLine = (HighestH + LowestL) / 2;// 트렌드 방향 결정if High = HighestH then IsTrendUp = true;if Low = LowestL then IsTrendUp = false;// 색상 설정if IsTrendUp = false then CurrentColor = ColorUpelse CurrentColor = ColorDn;// Pivot 감지PivotDetected = false;if IsTrendUp = false then begin if PH > 0 then PivotDetected = true;end else begin if PL > 0 then PivotDetected = true;end;// Volume Profile 계산if CurrentBar - PivotLength - StartBar > PivotLength then begin if PivotDetected then begin StartBar = CurrentBar - PivotLength; // 경계 설정 TopPrice = High; BotPrice = Low; for i = 0 to PivotLength * 2 begin if High[i] > TopPrice then TopPrice = High[i]; if Low[i] < BotPrice then BotPrice = Low[i]; end; // 레벨 계산 Levels = (TopPrice - BotPrice) / ATRValue; StepSize = (TopPrice - BotPrice) / Levels; // Volume Bins 초기화 for k = 0 to Levels begin VolumeBins[k] = 0; end; // Volume 수집 for i = 0 to PivotLength * 2 begin for k = 0 to Levels begin MidPrice = BotPrice + StepSize * k + StepSize / 2; if AbsValue(MidPrice - Close[i]) <= StepSize * 2 then VolumeBins[k] = VolumeBins[k] + Volume[i]; end; end; // POC (Point of Control) 찾기 POCVolume = 0; POCPrice = 0; for k = 0 to Levels begin if VolumeBins[k] > POCVolume then begin POCVolume = VolumeBins[k]; POCPrice = BotPrice + StepSize * k + StepSize / 2; end; end; end;end;// 플롯Plot1(TrendLine, "Trend");if ShowProfile thenPlot2(POCPrice, "POC Level");// 색상 적용SetPlotColor(1, CurrentColor);SetPlotWidth(1, 4);if ShowProfile then begin SetPlotColor(2, CurrentColor); SetPlotWidth(2, 1);end;
2025-10-25
102
글번호 227297
지표
답변완료
시스템식 및 종목 검색식 3가지 질문 드립니다.
안녕하세요항상 빠른 답변 감사 드립니다 3가지 질문을 드립니다. 1번 아래 식을 피라미딩 입력값에 따라 진입이 가능하게 요청 드립니다. 퍼센트 간격은 0.5, 1, 2 ,4, 8 ,16 ~~ 투입 금액도 1, 2, 4, 8 ~~ 진입식 퍼센트 , 금액은 무한 증분 이지만 피라미딩 입력 횟수값(2회~5회)으로 사용하려고 합니다.간격 및 증분에 대한 질문에 오류가 있다면 구현 가능한 선에서 지도 편달 요청 드립니다.// 진입
input : threshold_percent(0.5);
input : additional_long__percent(0.5);
input : additional_short_rise_percent(0.5);
var : threshold(0),addLong(0),addShortRise(0);
var : longCondition(False),shortCondition(False);
var : longAddCondition(False),shortAddCondition(False);
var : hasLongPosition(False),hasShortPosition(False);
threshold = threshold_percent / 100.0;
addLong = additional_long__percent / 100.0;
addShortRise = additional_short_rise_percent / 100.0;
longCondition = DHL2 >= low and (CrossUp(low, var1) or CrossUp(low, var2) or CrossUp(low, var5)) and low <= DHL2 * (1 - threshold);
shortCondition = DHL2 < low and (CrossDown(high, var1) or CrossDown(high, var2) or CrossDown(high, var5)) and low > DHL2 * (1 + threshold);
// 추가 롱 조건: 롱 포지션 중 진입가 대비 추가 하락 시 및 롱 신호
longAddCondition = (MarketPosition > 0) and (close <= entryPrice * (1 - addLong)) and longCondition;
// 추가 숏 조건: 숏 포지션 중 진입가 대비 추가 상승 시 및 숏 신호
shortAddCondition = (MarketPosition < 0) and (close >= entryPrice * (1 + addShortRise)) and shortCondition;
hasLongPosition = MarketPosition > 0;
hasShortPosition = MarketPosition < 0;
// 포지션 없을 때만 기존 롱/숏 Condition으로 진입
if (hasLongPosition == False and longCondition) Then
Buy("Long");
if (hasShortPosition == False and shortCondition) Then
Sell("Short");
// 롱 포지션 보유 시 추가 롱 진입 조건만 실행
if (MarketPosition > 0 and MaxEntries == 1) Then
{
if (longAddCondition) then
{
Buy("물Long");
}
}
if (MarketPosition < 0 and MaxEntries == 1) Then
{
if (shortAddCondition) Then
{
Sell("불Short");
}
}
2번 시스템식 시험적용시 날짜 및 시간을 입력하여 적용 날짜 및 시간을 적용 하고자 합니다. 관련 식을 요청 드립니다.3번 종목 검색에서 아래와 같이 년봉 기준으로 검색을 하고자 합니다. 년저[2] > 년저[1] < 년저Ps. 수식 작성 예제 링크 오류 수정 요청 드립니다. https://www.yesstock.com/YesTrader/YesLanguage/YesLanguage_help.html그럼 좋은 하루 되세요
2025-10-24
138
글번호 227292
지표