Swing High/Low tracking to find out the bias
I’ve tried to modify the code below “Swing Points By:tufedtm” in term of my desired conditions. since I’m not familiar with arrays and am rookie in coding, may I write what I’m expect may be you can guide me if it’s possible.
The complete code costumed a little bit be myself:
Pine Script Market Structure High and Low for each new range
I’m trying to modify the code below written by “geneclash” and it works in a way which I’m not interested. I want to see the code runs on each timefram, lookback from i.e 500 or less last bars and for a swing high, create a line (MSH), and also a line for the last and closest swing low to that swing high (MSL), then if price crossovers the MSH, will wait till the new swing high is being created (all needed candles must be closed and the new swing high is confirmed) and the new swing high will be the new MSH and the old MSH will be deleted and again the last and closest swing low to that swing high, will be the new MSL (in this case the new MSL will be replced immediately because either a new swing low has been created or the old MSL is still the last and closest MSL and can be used. On the other hand. if price crossunder the MSL, the last and closest swing high will be still in use or the new MSH will be updated and when a new swing low is confirmed, the new MSL will be plotted. But this code create MSH and MSL and wont update it in the way I’m fond of. I’ll be appreciated if you kindly guid me how to overcome this issue.
Pine Script Market Structure High and Low for each new range
I’m trying to modify the code below written by “geneclash” and it works in a way which I’m not interested. I want to see the code runs on each timefram, lookback from i.e 500 or less last bars and for a swing high, create a line (MSH), and also a line for the last and closest swing low to that swing high (MSL), then if price crossovers the MSH, will wait till the new swing high is being created (all needed candles must be closed and the new swing high is confirmed) and the new swing high will be the new MSH and the old MSH will be deleted and again the last and closest swing low to that swing high, will be the new MSL (in this case the new MSL will be replced immediately because either a new swing low has been created or the old MSL is still the last and closest MSL and can be used. On the other hand. if price crossunder the MSL, the last and closest swing high will be still in use or the new MSH will be updated and when a new swing low is confirmed, the new MSL will be plotted. But this code create MSH and MSL and wont update it in the way I’m fond of. I’ll be appreciated if you kindly guid me how to overcome this issue.
Pine Script Market Structure High and Low for each new range
I’m trying to modify the code below written by “geneclash” and it works in a way which I’m not interested. I want to see the code runs on each timefram, lookback from i.e 500 or less last bars and for a swing high, create a line (MSH), and also a line for the last and closest swing low to that swing high (MSL), then if price crossovers the MSH, will wait till the new swing high is being created (all needed candles must be closed and the new swing high is confirmed) and the new swing high will be the new MSH and the old MSH will be deleted and again the last and closest swing low to that swing high, will be the new MSL (in this case the new MSL will be replced immediately because either a new swing low has been created or the old MSL is still the last and closest MSL and can be used. On the other hand. if price crossunder the MSL, the last and closest swing high will be still in use or the new MSH will be updated and when a new swing low is confirmed, the new MSL will be plotted. But this code create MSH and MSL and wont update it in the way I’m fond of. I’ll be appreciated if you kindly guid me how to overcome this issue.
Pine Script Market Structure High and Low for each new range
I’m trying to modify the code below written by “geneclash” and it works in a way which I’m not interested. I want to see the code runs on each timefram, lookback from i.e 500 or less last bars and for a swing high, create a line (MSH), and also a line for the last and closest swing low to that swing high (MSL), then if price crossovers the MSH, will wait till the new swing high is being created (all needed candles must be closed and the new swing high is confirmed) and the new swing high will be the new MSH and the old MSH will be deleted and again the last and closest swing low to that swing high, will be the new MSL (in this case the new MSL will be replced immediately because either a new swing low has been created or the old MSL is still the last and closest MSL and can be used. On the other hand. if price crossunder the MSL, the last and closest swing high will be still in use or the new MSH will be updated and when a new swing low is confirmed, the new MSL will be plotted. But this code create MSH and MSL and wont update it in the way I’m fond of. I’ll be appreciated if you kindly guid me how to overcome this issue.
pinescript labels are deleted when tradingview is updated
I’m trying to output my indicator labels on my chart under certain conditions. This works even if my script runs from the market start. Unfortunately, the labels are deleted again after a tradingview chart update. Var values are also deleted again in a table on the chart and are no longer displayed. It seems that this is just a display error that the script runs without errors. The script runs with real-time candles. So how can I safely output labels under certain conditions without them being deleted again by the character update and also displayed in real time in the past and current candles?
Reproducing the “Compare” Feature in TradingView with Pine Script
Reproducing the “Compare” Feature in TradingView with Pine Script
Pinescript – Transfer price from real-time candle to non-real-time candle
I would like to save a price in a real-time candle in a varip. As far as I know, this is done with close in a real-time candle. The problem is that the real-time price that was written into the var in the real-time candle with varip myprice = close is overwritten in the next candle with the last candle close of the real-time candle.
Pinescript – Compare price of Premarket with another close price
I want to trigger a function when two prices have the same value. Unfortunately, I can’t do this.
Apparently the prices are not quite the same and I can’t run the function. How can I solve this problem?