OPEN-SOURCE SCRIPT
Мой скрипт

inputs:
window(1),
type(0), // 0: close, 1: high low, 2: fractals up down, 3: new fractals
persistent(False),
exittype(1),
nbars(160),
adxthres(40),
nstop(3000);
vars:
currentSwingLow(0),
currentSwingHigh(0),
trailStructureValid(false),
downFractal(0),
upFractal(0),
breakStructureHigh(0),
breakStructureLow(0),
BoS_H(0),
BoS_L(0),
Regime(0),
Last_BoS_L(0),
Last_BoS_H(0),
PeakfilterX(false);
BoS(window,persistent,type,Bos_H,BoS_L,upFractal,downFractal,breakStructureHigh,breakStructureLow);
//BOS Regime
If BoS_H[1] <> 0 then begin
Regime = 1; // Bullish
Last_BoS_H = BoS_H[1];
end;
If BoS_L[1] <> 0 Then begin
Regime = -1; // Bearish
Last_BoS_L = BoS_L[1];
end;
//Entry Logic: if we are in BoS regime then wait for break swing to entry
if ADX(5) of data2 < adxthres then begin
if time>900 and Regime = 1 and EntriesToday(date)= 0 and Last_BoS_H<upFractal then
begin
if close > upFractal then buy next bar at market;
end;
if time>900 and EntriesToday(date)= 0 and Regime = -1 and Last_BoS_L>downFractal then
begin
if close < downFractal then sellshort next bar at market;
end;
end;
// Exits: nbars or stoploss or at the end of the day
if marketposition <> 0 and barssinceentry >nbars then begin
sell next bar at market;
buytocover next bar at market;
end;
setstoploss(nstop);
setexitonclose;
window(1),
type(0), // 0: close, 1: high low, 2: fractals up down, 3: new fractals
persistent(False),
exittype(1),
nbars(160),
adxthres(40),
nstop(3000);
vars:
currentSwingLow(0),
currentSwingHigh(0),
trailStructureValid(false),
downFractal(0),
upFractal(0),
breakStructureHigh(0),
breakStructureLow(0),
BoS_H(0),
BoS_L(0),
Regime(0),
Last_BoS_L(0),
Last_BoS_H(0),
PeakfilterX(false);
BoS(window,persistent,type,Bos_H,BoS_L,upFractal,downFractal,breakStructureHigh,breakStructureLow);
//BOS Regime
If BoS_H[1] <> 0 then begin
Regime = 1; // Bullish
Last_BoS_H = BoS_H[1];
end;
If BoS_L[1] <> 0 Then begin
Regime = -1; // Bearish
Last_BoS_L = BoS_L[1];
end;
//Entry Logic: if we are in BoS regime then wait for break swing to entry
if ADX(5) of data2 < adxthres then begin
if time>900 and Regime = 1 and EntriesToday(date)= 0 and Last_BoS_H<upFractal then
begin
if close > upFractal then buy next bar at market;
end;
if time>900 and EntriesToday(date)= 0 and Regime = -1 and Last_BoS_L>downFractal then
begin
if close < downFractal then sellshort next bar at market;
end;
end;
// Exits: nbars or stoploss or at the end of the day
if marketposition <> 0 and barssinceentry >nbars then begin
sell next bar at market;
buytocover next bar at market;
end;
setstoploss(nstop);
setexitonclose;
오픈 소스 스크립트
트레이딩뷰의 진정한 정신에 따라, 이 스크립트의 작성자는 이를 오픈소스로 공개하여 트레이더들이 기능을 검토하고 검증할 수 있도록 했습니다. 작성자에게 찬사를 보냅니다! 이 코드는 무료로 사용할 수 있지만, 코드를 재게시하는 경우 하우스 룰이 적용된다는 점을 기억하세요.
면책사항
해당 정보와 게시물은 금융, 투자, 트레이딩 또는 기타 유형의 조언이나 권장 사항으로 간주되지 않으며, 트레이딩뷰에서 제공하거나 보증하는 것이 아닙니다. 자세한 내용은 이용 약관을 참조하세요.
오픈 소스 스크립트
트레이딩뷰의 진정한 정신에 따라, 이 스크립트의 작성자는 이를 오픈소스로 공개하여 트레이더들이 기능을 검토하고 검증할 수 있도록 했습니다. 작성자에게 찬사를 보냅니다! 이 코드는 무료로 사용할 수 있지만, 코드를 재게시하는 경우 하우스 룰이 적용된다는 점을 기억하세요.
면책사항
해당 정보와 게시물은 금융, 투자, 트레이딩 또는 기타 유형의 조언이나 권장 사항으로 간주되지 않으며, 트레이딩뷰에서 제공하거나 보증하는 것이 아닙니다. 자세한 내용은 이용 약관을 참조하세요.