mafe wrote: Sun May 11, 2025 8:21 am
Hi, thank you for your effort to make us better traders, I noticed form the common of this indicator it says non repaint, but it does repaint
I've analyzed the code you provided for the "TMA+CG.mq4" indicator. Let me explain how the arrow drawing logic works and confirm whether the arrows repaint or disappear.
The key section for the arrow drawing is in the start() function:
Code: Select all
// Arrow drawing logic for first signal of each direction
if (High[i+1]>upBuffer[i+1] && Close[i+1]>Open[i+1] && Close[i]<Open[i]) {
if (lastDirection != 1) { // Only draw if last direction was not up
upArrow[i] = High[i]+iATR(NULL,0,20,i);
lastDirection = 1;
}
}
if (Low[i+1]<dnBuffer[i+1] && Close[i+1]<Open[i+1] && Close[i]>Open[i]) {
if (lastDirection != -1) { // Only draw if last direction was not down
dnArrow[i] = Low[i]-iATR(NULL,0,20,i);
lastDirection = -1;
}
}
Looking at these elements:
The indicator includes a line that explicitly states #property description "no repaint" which is a good sign.
The arrow signal is based on completed bars (i+1), not the current bar. It looks at historical price action that cannot change once a bar is closed.
The indicator uses a lastDirection variable to track the previous signal direction, which helps prevent multiple arrows of the same type from appearing consecutively.
At the top of the indicator, there's a note stating the arrow code was designed "according to idea presented by rajiv" and "no repaint."
Based on this analysis, I can confirm that the arrows in this indicator should not repaint or disappear once they're drawn because:
They only appear based on completed bar data (i+1)
The signal conditions depend on the relationship between past bars and indicator values
The code has specific logic to prevent duplicated signals in the same direction
The arrows will remain fixed once they appear on the chart because they're based on historical data that cannot change. This is a properly designed "no repaint" indicator.
by :Claude
Anyway Thank For Testing The Indicator.