i want to change dynamically request.security in pine script
src = input(close, title=”Source”) expdt = input.string(“240829″,”SELECT EXPIRY DATE”) vx = str.tostring(int(close)) vln = str.length(vx) vlnm = vln-2 vxx = str.substring(vx,0,vlnm) sid = syminfo.tickerid exdt = expdt syCE =sid+exdt+”C”+str.tostring(vxx)+”00″ syPE = sid+exdt+”P”+str.tostring(vxx)+”00″ tic1 = input.symbol(“NSE:NIFTY240606C24000″,”SELECT SYMBOL Call”) tic2 = input.symbol(“NSE:NIFTY240606C23500″,”SELECT SYMBOL Call”) tic1_vw = request.security(tic1, “05”, ta.vwap(close)) this will work but if i replace ‘tic1’ […]
Need long entry
I need your experties on the matter.
I created a code in tradingview that helps me identify long wick candles.
Pine Script 5. How to draw lines (High, Low) for individual quarters of the year?
`Indicator of quarterly lines “Quarter & lines”.
Quarters of the year.
Horizontal lines of the quarters.
how do I change the color of the plot() for the next bar after strategy.exit?
I use plot()
to draw the price movement of the selected asset (bars and shadows are visually disabled). The two colors for the short position are dark red when there are no short positions and light red when the short position is open. For example, the position of the short is open from 04:12 to 05:13, then this period of time will be light red using plot()
, and the rest of the time the color will be dark red. my problem is that plot()
stops coloring the line color one bar before exiting the position. Let’s look at the picture. I marked one bar with lines where the strategy left the position, the line is not colored light red. how can I fix this?
Pinescript, ni fractal in inside bar
can you help edit this script, i don’t know how to edit a script i only use ai, but my problem is i want the bar that created an inside bar and it’s preceding bar, if it not crossed it’s high or low it should not show any fractals.
How can I get the prices of the previous days at the end of the exchange in pinescript?
I tried to use the following code line to get the average of the previous 365 days, but it returns the lasts 365 bar prices:
How to set chart link in Alert condition
I make little modification in my post.
I just want to add chart link on my alertcondition. It could be useful for those who trade with many pairs / instruments.
Pine Script to display Pivot point and CPR
<pre><code>
Pine script cannot calculate the difference between Exit Price and the Entry Price in a Strategy though individually both are being calculated
** I’m trying to calculate the MTM (Mark to Market) of a trade entered through Strategy script. The concept is as follows: Once a position is entered and exited as per Strategy script, entry price and exit price is calculated using strategy.opentrades.entry_price(strategy.opentrades-1) strategy.closedtrades.exit_price(strategy.closedtrades-1) MTM = (Exit Price – Entry Price)*Quantity -for a Long Trade For […]
I have Order Blocks and FVG code in Pine Script V5, how to modify the code to detect, the overlapping of Order Block and FVG, when happens?
I have a code shown below to detect and plot Bullish Order Blocks, Bearish Order Blocks and Fair Value Gap. Now the code to be modified for detecting and plot circles, whenever Order Blocks and FVG are overlapping every time in the chart. Green Circle plot when Bullish Order Blocks overlapping with FVG and Vice versa with Red Circle plotted [Bearish OB with FVG][Bullish OB with FVG].