Circular reference
Forums › ProRealTime English forum › ProScreener support › Circular reference
- This topic has 2 replies, 2 voices, and was last updated 4 years ago by Nicolas.
-
-
04/07/2020 at 7:48 PM #125138
I’m trying to code a screener for demand and supply levels. I have successfully made indicators and I now want to screen markets.
I have made two functions that I call and each of them works separately in separate screeners. However. When I try to merge these two screeners into one I get a circular reference.
I have attached the code that works. But as soon as I uncomment the code underneath it gives me circular reference. I can’t figure out why.
Demand and supply screener123456789101112131415161718192021222324252627282930313233343536373839404142434445464748MaxCandleIterations = 200CurrentCandleIndex = 1ValueToReturn = -1WHILE CurrentCandleIndex < MaxCandleIterations// Check for demand.IF (OPEN > CLOSE) THENDemand, DemandBottom, DemandTop = CALL "Demand zone"[CurrentCandleIndex]// Buy signal here.IF (Demand = 1 AND LOW < DemandTop AND LOW > DemandBottom) THENValueToReturn = 1BREAKENDIF// Check for supply.ELSESupply, SupplyBottom, SupplyTop = CALL "Supply zone"[CurrentCandleIndex]// Sell signal here.IF (Supply = 1 AND HIGH > SupplyBottom AND HIGH < SupplyTop) THENValueToReturn = 0BREAKENDIF//IF (Supply = 0 AND HIGH > SupplyBottom AND HIGH < SupplyTop) THEN// Just iterate one more candle to make sure demand isn't hiding behind.//Supply, SupplyBottom, SupplyTop = CALL "Supply zone"[CurrentCandleIndex + 1]//IF (Supply = 0) THEN//BREAK//ENDIF//ENDIFENDIFCurrentCandleIndex = CurrentCandleIndex + 1WENDIF (ValueToReturn > -1) THENSCREENER (ValueToReturn AS "Zone")ENDIF04/09/2020 at 7:44 AM #125356Let’s see if I can clarify something 🙂
I have functions that I have created that both works fine and return 3 different values.
I have no idea why this gives me circle reference as soon as I uncomment the row: //Supply, SupplyBottom, SupplyTop = CALL “Supply zone”[CurrentCandleIndex + 1]
Anyone have any ideas at all?
04/09/2020 at 9:11 AM #125369 -
AuthorPosts
Find exclusive trading pro-tools on