IC Markets

How to detect divergence in forex scalping?

Optimize MetaTrader 4, MetaTrader 5, cTrader, and TradingView for speed. Discuss Level II Market Depth (DOM), custom hotkeys, and volume indicators.
FTtrader
Posts: 142
Joined: Mon Aug 03, 2026 2:43 pm

Re: How to detect divergence in forex scalping?

Post by FTtrader »

Core Architecture Shift in Pine v5

1. ⁠ta.lowestbars()⁠ Index Offset: ⁠ta.lowestbars(low[1], 15)⁠ returns a negative offset (e.g., ⁠-4⁠ means 4 bars before bar ⁠1⁠, so 5 bars ago from the current candle). Subtracting this value converts it cleanly into a positive shift index (⁠1 - (-4) = 5⁠) that can index into ⁠low[5]⁠ or ⁠stochK[5]⁠.

2. Native Dynamic Indexing: In Pine v5, using variables inside series subscripting (⁠stochK[shiftRecentLow]⁠) is natively supported without needing ⁠array.get()⁠ calls.

3. ⁠plotshape()⁠ vs Objects: Unlike MT4/MT5 where drawing persistent chart objects clutters chart memory, ⁠plotshape()⁠ evaluates once per bar on the GPU/server engine and doesn't require any manual cleanup code.

4. Alert Engine Integration: The included ⁠alertcondition()⁠ functions allow instant webhook routing out to automated trading bots or Telegram alerts.
PTScalper
Site Admin
Posts: 210
Joined: Mon Jul 20, 2026 1:28 pm

Re: How to detect divergence in forex scalping?

Post by PTScalper »

Cool, but it seems to me little bit more complicated.
Do you think it is possible to make it more simple?
Preserve your own money. Scale with the market's money. Exponential growth is the ultimate key.
Post Reply