BeatlemaniaSA wrote: Sun Jun 07, 2026 6:00 pm
Yes, it is entirely possible to code a Non-Repainting (NRP) version of **Solar Wind Joy**, but there is a major catch that you need to be aware of before using it.
To understand why, we have to look at what the indicator actually is under the hood and how its coding logic creates an optical illusion.
---
### The Reality of Solar Wind Joy
Underneath its unique name, Solar Wind Joy is just a poorly coded variation of John Ehlers’ **Fisher Transform** oscillator.
The reason the original Solar Wind Joy looks incredibly accurate on historical charts is due to a coding flaw in its main loops. Instead of calculating bar values sequentially from past to present, it looks *forward* into future bars to calculate the value of the current bar.
Specifically, its calculation lookback index looks like this:
```mql4
// The original repainting flaw looks forward into the future array index
MaxH = High
;
MinL = Low;
```
Because MT4 index arrays run backward (where `` is the current bar and `[i-1]` is a bar into the future relative to history), the indicator uses future price discovery to alter past data. When you refresh the chart or restart MT4, the history rewrites itself perfectly, making it look like it predicts tops and bottoms with 100% precision.
---
### What Happens in an NRP Version?
When developers code an NRP version, they fix the iteration loop direction and force the indicator to calculate using only completed historical bars (`i + k` instead of `i - k`).
While this physically stops the repainting, it reveals the true mathematical nature of the underlying calculation: **lag**.
Once converted to an NRP indicator, the perfectly smooth, predictive waves turn into a standard, lagging momentum oscillator. The sharp turning signals move forward by several bars, meaning you will often enter trades exactly when a trend is ending rather than when it is beginning.
---
### The NRP Code Structure
If you are looking to code or modify one yourself, the core logic change involves switching the array handling in the calculation loop so that it never evaluates an index lower than `i`.
A typical corrected, non-repainting loop structure in MQL4 looks like this:
Code: Select all
```mql4
int start() {
int counted_bars = IndicatorCounted();
if(counted_bars < 0) return(-1);
if(counted_bars > 0) counted_bars--;
int limit = Bars - counted_bars;
// Non-repainting calculation loop (counting down from past to present)
for(int i = limit; i >= 0; i--) {
double MaxH = High[i];
double MinL = Low[i];
// Look back into historical data only (i + k), never into future data (i - k)
for(int k = 0; k < Period; k++) {
if(High[i + k] > MaxH) MaxH = High[i + k];
if(Low[i + k] < MinL) MinL = Low[i + k];
}
// Price normalization and Fisher Transform formulas follow strictly using past data...
}
return(0);
}
```
### Recommendation
If you want a reliable version of this style of trading tool, skip looking for "Solar Wind Joy NRP" fixes entirely. Instead, look for a clean, properly coded **Ehlers Fisher Transform** indicator. It provides the exact same mathematical insight into market cycles without the misleading history or poorly optimized code structures found in old Solar Wind clones.