답변완료
기존시스템에 진입수정 신고저에 의한 진입조건
안녕 하세요 항상 감사합니다 많이도움받고 있읍니다
기존에 시스템도움받아 테스트기간동안 에러같은거는 발생하지않고 신호는
잘나와 주고있어요
주문관련 -+10틱정도제공되고 주문지연이나 시간정정은 있으나
미체결 시간경과에대한 자동취소는 제공되지않는게 아쉽습니다
그래서 죄송하지만 한번더 도움 받고자합니다
아래시스템 수식은 타주기 지표조합으로 진입시간청산시간
손익절이 들어간 시스템식입니다
{수정사항은 타분봉 데이타2,3 macd 0선이상이하 골든데드크로스 유지에서
신호일치는 기존과 동일합니다
데이터2,3 조건일치후 진입분봉 타점 수정부탁드립니다.
*추가사항 신고가(N일) 신저가(N일) 지표에는 이름이 이렇게 나옵니다
분봉으로 추가해보았는데 파일처럼 추가는 돼네요
(예시)로 1분봉상 100봉 신고가 추가해보왔어요 타분봉 데이타2,3이 매도조건이면
*진입봉에서 N(20)봉 기간동안 신고가 신호가 발생하였다면 macd선 0선하향돌파시
매도진입 입니다. 매수조건은 반대입니다.
기존방식 진입분봉 macd 0선 상하향돌파진입에서 N(20)봉 기간동안 신고가,신저가 추가
*청산조건 스탑로스 도달하거나 타주기 분봉데이타2 or 3 0선상관없이 macd선과 시그널
골든데드크로스시 청산합니다
-----------------------------------------------
input : short(12),long(26),sig(9);
input : 진입시작시간(230000),당일청산시간(020000),손절틱(100),감시틱(70),되돌림틱(20);
var : S1(0),D1(0),TM(0),EP1(0),EP2(0),EP3(0);
var : macdv(0,Data1),macds(0,Data1);
var : macdv1(0,Data2),macds1(0,Data2);
var : macdv2(0,Data3),macds2(0,Data3);
macdv = data1(macd(short,long));
macds = data1(Ema(macdv,sig));
macdv1 = data2(macd(short,long));
macds1 = data2(Ema(macdv1,sig));
macdv2 = data3(macd(short,long));
macds2 = data3(Ema(macdv2,sig));
if sDate != sDate[1] Then
SetStopEndofday(당일청산시간);
if Bdate != Bdate[1] Then
SetStopEndofday(0);
var : Tcond(False),OO(0),HH(0),LL(0),CC(0);
if (sdate != sDate[1] and sTime >= 당일청산시간) or
(sdate == sDate[1] and sTime >= 당일청산시간 and sTime[1] < 당일청산시간) Then
Tcond = false;
if (sdate != sDate[1] and sTime >= 진입시작시간) or
(sdate == sDate[1] and sTime >= 진입시작시간 and sTime[1] < 진입시작시간) Then
Tcond = true;
if Tcond == true Then
{
if MarketPosition <= 0 and CrossUp(MACDV,0) and MACDV1 > 0 and MACDV2 > 0 and
macdv > macds and macdv1 > macds1 and macdv2 > macds2 Then
Buy();
if MarketPosition >= 0 and CrossDown(MACDV,0) and MACDV1 < 0 and MACDV2 < 0 and
macdv < macds and macdv1 < macds1 and macdv2 < macds2 Then
Sell();
if MarketPosition == 1 and CrossDown(MACDV,0) Then
ExitLong();
if MarketPosition == -1 and CrossUp(MACDV,0) Then
ExitShort();
if MarketPosition == 1 Then
{
if highest(H,BarsSinceEntry) >= EntryPrice+PriceScale*감시틱 Then
ExitLong("bx",AtStop,highest(H,BarsSinceEntry)-PriceScale*되돌림틱);
}
if MarketPosition == -1 Then
{
if lowest(L,BarsSinceEntry) <= EntryPrice-PriceScale*감시틱 Then
ExitShort("sx",AtStop,lowest(L,BarsSinceEntry)+PriceScale*되돌림틱);
}
}
SetStopLoss(PriceScale*손절틱,PointStop);
*감사합니다
2025-05-04
379
글번호 190571
시스템
답변완료
질문 드리겠습니다
휴일 잘 쉬셨어요?
질문 몇 가지 부탁드리겠습니다
질문1)
아래 추세선 식에서 최근 3개는 나오지 않게 하려고 하는데 어떻게 수정해야 될까요?
TL_SetExtRight(tttl1[12],False);
tttl1[0]=tl_new(sd[2],st[2],aa[0],sd[0],st[0],aa[0]);
TL_SetSize(tttl1[0],0);
TL_SetDrawMode(tttl1[0],0);
TL_Delete(tttl1[12]);
TL_SetExtRight(tttl1[0],true);
질문2)
조건 추가에 대한 질문입니다
첨부된 수식에서
조건만족봉 사이 봉들의 평균값을 구해서 aa[] 배열에 넣었는데요,
조건만족봉 다음에 나오는 봉들을 봤을때
(다음 조건만족봉이 나오기 전까지 발생하는 봉들)
aa[0] 를 돌파하는 경우를 찾아보려고 합니다
(돌파 조건은 봉의 L이 aa[0] 보다 작고 H가 aa[0] 보다 큼) ,
aa[0] 값을 "2번째 돌파하는 봉"이 발생했을때 var4에 그 봉의 H값을 저장, var5에는 그 두개 봉의 고가의 평균을 저장 한다는 하위 조건문을 만들 수 있을까요?
예를들어서 현재만족봉 이후에 나오는 봉 a1, a2 ,a3,a4..들을 aa[0]와 비교했을때 a2 와 a4가 돌파봉이라면 a4 봉의 고가값을 저장.
감사합니다
var : cnt(0), sum1(0), sumi1(0),summ(0),tt(0),hh(0),ll(0),tl(0),tl1(0),n(0);
var: sum2(0),sumi2(0);
var : t(0),StartBarIndex(0),dd(0),d1(0),d2(0),e1(0),e2(0);
Array : ii[50](0),aa[50](0),cc[50](0),ee[50](0),ttl[30](0),tttl[40](0),tttl1[40](0),tttl2[40](0),sd[45](0),st[45](0);
Var33=Money/100000000;
if Bdate != Bdate[1] Then
{
DD = DD+1;
}
if (h>l*1.08) and (d1 == 0 or (d1 > 0 and dd >= d1+5)) and
(hh == 0 or (hh > 0 and (h >= hh*1.1 or h <= hh*0.85))) Then
{
d1 = dd;
hh = h;
var1 = Index;
Var2 = var1[1];
Var3 = Var2[1];
sum1=0; sumi1=0; sum2=0; sumi2=0;
tl=TL_NEW(sDate,sTime,100,sDate,sTime,999999);
TL_SetSize(tl,0);
TL_SetColor(tl,Black);
For cnt = 1 to (var1-Var2)
{
sum1=sum1+l[cnt];
sumi1=sumi1+1;
}
value1=sum1/sumi1;
For cnt = 49 DownTo 1
{
aa[cnt] = aa[cnt-1];
#ee[cnt]= ee[cnt-1];
}
aa[0] = value1*1;
}
2025-05-07
316
글번호 190569
지표
답변완료
지표 변환 부탁 드립니다
// ====================================================================================================================}
// INPUTS
// ===================================================================================================================={
// User inputs for customization
len = input.int(10, "Length")
dsl_mode = input.string("Fast", "DSL Lines Mode", ["Fast", "Slow"]) == "Fast" ? 2 : 1
// Color definitions
color_up = #8BD8BD
color_dn = #436cd3
// Condition for a dashed line
bool dashed = bool(bar_index % 2)
// ====================================================================================================================}
// CALCULATIONS
// ===================================================================================================================={
// Calculate RSI with a period of 10
RSI = ta.rsi(close, 10)
// Zero-Lag Exponential Moving Average function
zlema(src, length) =>
lag = math.floor((length - 1) / 2)
ema_data = 2 * src - src[lag]
ema2 = ta.ema(ema_data, length)
ema2
// Discontinued Signal Lines
dsl_lines(src, length)=>
up = 0.
dn = 0.
up := (src > ta.sma(src, length)) ? nz(up[1]) + dsl_mode / length * (src - nz(up[1])) : nz(up[1])
dn := (src < ta.sma(src, length)) ? nz(dn[1]) + dsl_mode / length * (src - nz(dn[1])) : nz(dn[1])
[up, dn]
// Calculate DSL lines for RSI
[lvlu, lvld] = dsl_lines(RSI, len)
// Calculate DSL oscillator using ZLEMA of the average of upper and lower DSL Lines
dsl_osc = zlema((lvlu + lvld) / 2, 10)
// Calculate DSL Lines for the oscillator
[level_up, level_dn] = dsl_lines(dsl_osc, 10)
// Determine color based on oscillator position relative to its DSL Lines
color = color.from_gradient(dsl_osc, level_dn, level_up, color_dn, color_up)
// ====================================================================================================================}
// PLOT
// ===================================================================================================================={
// Plot upper and lower DSL Lines
plot(level_up, color = dashed ? color.new(color_up, 20) : na, editable = false)
plot(level_dn, color = dashed ? color.new(color_dn, 20) : na, editable = false)
// Plot the DSL oscillator
plot(dsl_osc, color = color, linewidth = 2)
// Detect crossovers for signal generation
up = ta.crossover(dsl_osc, level_dn) and dsl_osc < 55
dn = ta.crossunder(dsl_osc, level_up) and dsl_osc > 50
// Plot signals on the oscillator
plotshape(up ? dsl_osc[1] : na, "", shape.circle, location.absolute, color_up, -1, "", chart.fg_color, false, size.tiny)
plotshape(dn ? dsl_osc[1] : na, "", shape.circle, location.absolute, color_dn, -1, "", chart.fg_color, false, size.tiny)
// Plot signals on the chart
plotshape(up, "", shape.triangleup, location.bottom, color_up, 0, "Enter", chart.fg_color, true, size.tiny,
force_overlay = true)
plotshape(dn, "", shape.triangledown, location.top, color_dn, 0, "Exit", chart.fg_color, true, size.tiny,
force_overlay = true)
// Color the background on signal occurrences
bgcolor(up ? color.new(color_up, 90) : na, force_overlay = true, editable = false)
bgcolor(dn ? color.new(color_dn, 90) : na, force_overlay = true, editable = false)
// Color candles based on signals
candle_col = up ? color.new(color_up, 0) : dn ? color.new(color_dn, 0) : na
plotcandle(open, high, low, close, "",
candle_col,
candle_col,
bordercolor = candle_col,
force_overlay = true,
editable = false)
// Plot horizontal lines for visual reference
h = plot(75, display = display.none, editable = false)
m = plot(50, display = display.none, editable = false)
l = plot(25, display = display.none, editable = false)
// Fill areas between horizontal lines
fill(m, h, 120, 50, color_up, na, editable = false)
fill(m, l, 50, -20, na, color_dn, editable = false)
// ====================================================================================================================}
2025-05-03
358
글번호 190565
지표