Hi everyone,
I’m hoping someone here can help me out. A friend of mine used AI to create an indicator for ProRealTime, but we’re running into some issues with the code. The indicator is called the “Trend Sequence Breaker (TSB)” and is supposed to identify trends and sequence breaks based on high and low points. However, we are having trouble getting it to work correctly. The indicator uses dots in different colors, to show high, lows, and breack of a sequence.
Here’s the code we have so far:
// Trend Sequence Breaker (TSB)
// Function to determine the trend
If Close > Highest(Close[1], 2) Then
trend := 1 // Bullish Trend
ElseIf Close < Lowest(Close[1], 2) Then trend := -1 // Bearish Trend
Else trend := 0 // “side” Trend
EndIf
// Identification of max and mins
isHigh := High = Highest(High[1], 2)
isLow := Low = Lowest(Low[1], 2)
// Identification of sequence breaks
If (trend < 0 AND (High > High[1] OR Low > Low[1])) OR (trend > 0 AND (High < High[1] OR Low < Low[1])) Then
isBreak := True
Else isBreak := False
EndIf
// Drawing of the circles
If isHigh Then DrawSymbol(High, “circle”, RGB(255, 165, 0)) // Orange
EndIf
If isLow Then DrawSymbol(Low, “circle”, RGB(0, 255, 255)) // Cyan
EndIf
If isBreak Then DrawSymbol(Close, “circle”, RGB(255, 0, 255)) // Magenta
EndIf
We are encountering some issues and the indicator doesn’t seem to be working as expected. If anyone could take a look and let me know what needs to be fixed, it would be greatly appreciated!
Thank you in advance for your help!