Welcome to NexusFi: the best trading community on the planet, with over 200,000 members Sign Up Now for Free
Genuine reviews from real traders, not fake reviews from stealth vendors
Quality education from leading professional traders
We are a friendly, helpful, and positive community
We do not tolerate rude behavior, trolling, or vendors advertising in posts
We are here to help, just let us know what you need
You'll need to register in order to view the content of the threads and start contributing to our community. It's free for basic access, or support us by becoming an Elite Member -- discounts are available after registering.
-- Big Mike, Site Administrator
(If you already have an account, login at the top of the page)
I read in this article by Andrea Unger (four-time World Trading Champion) that, thanks to the DVI David Varadi Intermediate oscillator, he was able to improve the performance of a Trading System based on breakouts.
I wanted to ask if anyone has the formula in easylanguage for this oscillator, so that I can test it with other Indices.
The original article in Italian is here:
Breakout e filtri intelligenti: l’oscillatore DVI per migliorare le performance sul Nasdaq:
thank you for your reply. I hope someone will be able to convert the DVI David Varadi Intermediate Oscillator code from Pine Script (TradingView) to Easylanguage, because I use Tradestation.
thank you for your reply. I hope someone will be able to convert the DVI David Varadi Intermediate Oscillator code from Pine Script (TradingView) to Easylanguage, because I use Tradestation.
In case you're still looking for this, I asked AI to help and got this indicator:
// David Varadi DVI - Unified Version
// Iterator variable updated to J1 per user request
inputs:
CalculationMode(1), // 1 = Pine Script Version, 2 = Classic (Directional) Version
Lookback(252), // Window for PercentRank
mmult(0.8), // Magnitude Weight
smult(0.2), // Stretch Weight
// Pine Version Lengths
nlen1(5), nlen2(100), nlen3(5),
mlen1(10), mlen2(100), mlen3(2);
// --- 1. Basic Component (Relative Price) ---
r = Close / Average(Close, 3) - 1;
// --- 2. Calculate Components based on Mode ---
if CalculationMode = 1 then begin
// PINE SCRIPT VERSION (Double Stretch approach)
mag_val = Average((nlen1 * Average(r, nlen1) + nlen2 * Average(r, nlen2) / 10) / 2, nlen3);
str_val = Average((mlen1 * Average(r, mlen1) + mlen2 * Average(r, mlen2) / 10) / 2, mlen3);
end
else if CalculationMode = 2 then begin
// CLASSIC VERSION (Directional approach)
UpCount = CountIf(Close > Close[1], 5);
DnCount = CountIf(Close < Close[1], 5);
if (UpCount + DnCount) > 0 then
mag_val = UpCount / (UpCount + DnCount)
else
mag_val = 0.5;
str_val = Average(r, 5);
end;
// --- 3. Rolling PercentRank (0-100) using J1 ---
count_mag = 0;
count_str = 0;
for J1 = 0 to Lookback - 1 begin
if mag_val > mag_val[J1] then count_mag = count_mag + 1;
if str_val > str_val[J1] then count_str = count_str + 1;
end;
Mode 1 Weighting Bug
The canonical magnitude formula is:
mag = SMA( (SMA(r,5) + SMA(r,100)/10) / 2, 5)
Note the /10 normalization on the longer-period SMA -- it gives roughly 10:1 weight to the short-term component. But the posted code evaluates to:
(5*SMA(r,5) + 10*SMA(r,100)) / 2
The period values (nlen1=5, nlen2=100) are being used as multipliers on the SMAs, which wasn't intended. This flips the weighting to roughly 1:2 favoring the long-term average -- the exact opposite of the canonical behavior.
Mode 1 Stretch Uses Wrong Input
Both mag_val and str_val in Mode 1 use r (smoothed returns). The canonical stretch uses a directional binary -- +1 for up days, -1 for down days -- not returns. So Mode 1 is basically running two magnitude calculations with different smoothing periods.
Mode 2 Labels Are Swapped
mag_val uses UpCount/(UpCount+DnCount) -- that's directional counting, which is the stretch logic. And str_val uses Average(r,5) -- smoothed returns, which is magnitude logic. The variable names are reversed.
The good news -- the PercentRank step, the defaults (252 lookback, 80/20 weighting), and the overall structure are solid. The original research showed edge at extremes on SPY. Get the component formulas locked down and you've got a clean implementation worth testing.
-- Fi "The AI got you 80% there -- but in trading, the last 20% is where the edge lives or dies."
Please leave feedback here. You can disable my ability to reply to your posts by placing me on your ignore list.
Fi provides educational information on a best-effort basis only. You are responsible for your own trading decisions and for verification of all data. This message is not trading advice.