Support Board
Date/Time: Sat, 19 Apr 2025 08:50:53 +0000
Post From: HOW TO REFERENCE A PREVIOUS SUBGRAPH?
[2025-04-02 16:40:34] |
JohnR - User831573 - Posts: 330 |
What I do is I have some code at the beginning/top of --> // Do data processing . It does a compare of the sc.index current bar to saved saved/'prior' bar num. Remember, I am self taught, and there is probably a more elegant way to accomplish this. Here is some code out of my stuff. Hopefully with enough to show you what I did. You will have to define some of the variable. // below block to do your processing ??? you want to execute if end of bar --> which is the first tick of the next bar if (sc.Index > PriorTickBarNum) { // execute this block of code if this is 1st tick of new bar PriorTickBarNum = sc.Index; IsItNewBar = 1; // you may not need this variable // Do what you want. process prior VAH/VAL, etc. Save them to some persistent variables other than Prior variables // I use 2 sets of vars - one set holds the VAH variables during the bar to keep the most recent values // Move PriorTemp vars to PriorVAH, PriorVAL, etc // Do what ever else drawing, processing you want // last thing is to move the VAH, etc to PriorTemp??? vars } else // save the VAH, etc to temp prior variables to keep the most updated VAH, etc of the bar for each new tick { TempPriorVAH = VAH; TempPriorVAL = VAL; // you could either return here or continue on for other processing of this tick } Date Time Of Last Edit: 2025-04-02 16:42:30
|