When I switched the time frame, the arrows disappeared ── creating a way to save and restore the arrows of the signal tool, and the misalignment that occurred afterward
Three approaches to fix | Two types arrows with different criteria lined up on one board | Zero times notification sounded by reverted arrows |
I am lab.aiueo, creating MT4/MT5 indicators and selling them on GogoJungle.
In June, someone who purchased SMC-Signal contacted me.
After entering based on the arrow, when you check the higher timeframe and revert to the original timeframe, the arrow and take-profit line disappear.
You cannot review the arrow that formed the entry later. For users, this is the most troublesome way for arrows to disappear.
Today, I will write about the cause, how to fix it, and another “drift” that happened after the fix.
When you switch timeframe, the indicator restarts from the beginning
In MT4, when you switch the chart timeframe, the indicator for that chart stops, restarts from the beginning. All drawn arrows and lines disappear temporarily.
After that, the indicator redraws from past prices. Things that can be redrawn come back; things that cannot be redrawn stay disappeared.
While using the same timeframe, SMC-Signal arrows do not disappear. They disappear only when switching timeframes or restarting MT4.
What disappeared was the “retest” arrow
There are two ways to display SMC-Signal arrows.
- Break: appears when the price closes beyond the previous high/low
- Retest: appears after a break when the price returns to the same direction up to OB or FVG
The break arrow can be re-evaluated from past price data, so redraws bring it back.
Retest judgments were built to look at only the just-formed candle. As time passes, that candle is no longer the “just-formed” candle. When redrawing, there were no applicable candles, and arrows, as well as take-profit and stop-loss lines, did not return.
There were three proposed fixes
- Re-evaluate retests using past prices
- Save the appeared arrow to a file on the spot and read it back after restarting
- Use 1 for breaks and 2 for retests, and use them accordingly
I did not choose option 1 because there was no guarantee I could recreate the exact state at that time. Retest judgments require the OB/FVG that were valid at that moment. If the recreated result differs from the arrow that actually appeared, it would become an indicator where arrows change later.
Option 3 would double the work since it would require two revert methods. The effort would double when fixing.
Therefore, I chose option 2. Save the value at the moment it appeared, and redraw as is. There is no way to reflect a different arrow from the moment it appeared.
Save and revert design (Ver1.03, June 5)
- Save destination: one file per currency pair and timeframe (e.g., EURUSD_15.csv for EURUSD 15-minute)
- Saved contents: candle time, direction, entry price, stop loss, three take-profits, risk-reward, and points
- When saving: add one row at the moment the arrow appeared. Do not write the same candle/direction twice
- When reverting: read once on first startup calculation. Draw the arrows within the loaded chart range, and draw only the latest set of take-profit and stop-loss lines
- Notifications: reverted arrows do not trigger alerts or notifications. If past arrows trigger, it would be mistaken for a new arrow
- Cleanup: delete rows older than the chart range
- Settings: made to be able to disable saving for those who do not want it (PersistSignals)
Separating files by timeframe is because retests only make sense for that timeframe’s candles. When you switch to 1-hour, it reads the 1-hour file.
Another drift that occurred after the fix
In August, someone who purchased the MT5 version reported, "Only sell arrows appear on past charts."
At first I suspected a porting error. But the judging code is the same as the MT4 version.
The cause was how points were assigned when redraw past data.
SMC-Signal uses five bases (OB, FVG, Premium/Discount, Sweep, and the direction of the higher timeframe) to assign points, and will emit an arrow when the threshold is reached.
When redrawing past candles, I counted the direction of the higher timeframe not as of that candle's point in time, but as the moment it was entered into the chart. Sweep was counted the same way.
If the higher timeframe is downward when you enter the chart, every past candle will receive one point for selling and zero for buying. In the default settings, with 2 points an arrow would appear, so buy arrows almost disappeared on past charts.
So why did buy arrows appear in the MT4 version?
Because MT4 version had been moved earlier, the actual arrows that appeared were restored from a saved file created in June. The saved arrows have the correct points based on the higher timeframe at the time they appeared.
In other words, on one chart, two types of arrows with different criteria were lined up.
- Arrows restored from the saved file: scored based on the state at appearance
- Arrows drawn from past prices: scored based on the state at the moment they were entered into the chart
The MT5 version had just been released, and the saved files were almost empty. Therefore, only the latter were visible.
“Recount at that candle’s point” (MT4 Ver1.08, MT5 Ver1.01)
On the August 29 version, I fixed the recount method when redraw past data.
- Sweep: do not count events occurring after that candle
- Higher timeframe direction: judge based on the higher timeframe containing that candle’s period, and ignore any candles newer than that candle
I also calculated the direction shown on the panel using the same method as the points. Calculating them separately could cause the panel to show downward while points show upward, leading to inconsistencies.
To be honest, the points for OB and FVG are still not fully “as of that candle’s point in time.” This is because the system does not currently retain zones for past candles. When first entering a chart, only OB and FVG are counted using the zones as they existed at that moment.
In September I also found and fixed an issue where arrows would be applied to past candles while the chart was still moving.
Decisions made as the creator
- Arrows that can only be judged at that instant should save the value at appearance and revert
- When redraw past data, count everything using the information of that candle. Do not apply the current state retroactively
- If saved and redrawn items line up on the same chart, verify that they share the same criteria
- Reverted arrows do not trigger notifications
SMC-Signal
A signal tool that scores five bases and emits arrows on confirmed candles. Even if you switch timeframes or restart MT4/MT5, it restores the appeared arrows and take-profit/stop-loss lines.
SMC-Signal (MT4) | View sales page |
SMC-Signal MT5 | View sales page |
This article is based on my own development and feedback from purchasers. The indicator described is a tool to assist market analysis and does not guarantee profits. Arrows do not encourage buying or selling. Investment decisions are your responsibility.
Thank you for reading to the end.