Tradingview pine script strategy creating entry on wrong candle
I’m experimenting with the Donchian channel breakout strategy and aiming to make an entry on the same candle when the current candle breaks above the previous Donchian upper band. I want to set the entry price to the previous Donchian upper band instead of the current candle’s close. However, it’s not working as expected. I added a plotshape to verify the logic, and it does show the shape on the correct candle, but the entry is happening on the wrong one.
Pine Script: Prevent Recalculation of Higher Timeframe Logic When Switching Timeframes
Objective: If consolidation zones are plotted at Upper value (example 53000 and lower value 52500) with lines, the same should be visible on 5 min chart at same levels. This is to see consolidation zone of higher timeframes on the chart with lower timeframe. with below code, the zones are identified and plotted correctly on 15 min chart but same zone levels are not plotted when the chart is changed to 5 min time frame.
İn pine script the code that ı copy from someone else is give an error but original code has not an error
London = time(timeframe.period, Londont) US = time(timeframe.period, USt) Asia = time(timeframe.period, Asiat) var clondonhigh = 0.0 var clondonlow = close var londontime = time var flondonhigh = 0.0 var flondonlow = 0.0 var flondonopen = 0.0 var onelondonfalse = false if London if high > clondonhigh clondonhigh := high clondonhigh if low < clondonlow clondonlow […]
Run code at custom duration timeout intervals
I want to run code in an indicator at custom duration timeout intervals in pine script. But pine script runtime behaves in strange way. First it waits then it start logging at every second.
How can I achieve this functionality.
How to remove the zones which are tested
I am facing this problem in my custom indicator on trading where i am able to draw the zones but i want to remove those zones which are either tested (price has come in contact with the zone) or violated (price which went crossed the zones)
if first condition met then ignore other condition
please help, in this code if first condition met then ignore other condition. Like if fvg_5_up and above_rsi[2]
condition are true then not calculate others like python if, elif and else function. Same if fvg_5_up and above_rsi[2],[3] are not condition met but fvg_5_up and above_rsi[4] and fvg_5_up and above_rsi[5] met then plotshape only first condition met ‘fvg_5_up and above_rsi[4]’. some time met all 5 condition but plotshape only first condition. please help me.
Need Help Fixing My Trading Script – Stop Loss Not Closing Position Fully
I’ve been trying to fix this issue with my trading script for days now, but I’m stuck. The problem is that when the stop loss is hit, the position doesn’t get closed 100%. Instead, it hits the stop loss, and if the price goes back to TP1, the whole position closes at that point.
Need Help Fixing My Trading Script – Stop Loss Not Closing Position Fully
I’ve been trying to fix this issue with my trading script for days now, but I’m stuck. The problem is that when the stop loss is hit, the position doesn’t get closed 100%. Instead, it hits the stop loss, and if the price goes back to TP1, the whole position closes at that point.
Creating static horizontal line at particular price for tommorows date
Here is the code written in pinescript. but line is not showing in the chart. Need suggestion to correct my code.
How to add label in default volume indicator in pine-script?
I am using default volume indicator on chart, which changes volume bar color according to previous close price etc.