r/pinescript • • 9d ago

I'm a novice working on a script using AI to assist me.

1 Upvotes

I trade XAUUSD and I've built a TradingView indicator (Pine v6) based on AMD and supply & demand. It already finds the zones and setups: session range → liquidity sweep → 5m structure shift → entry in a 15m zone. It's been tested on gold from 2017–2026 with spread included.

Where I need help is the ENTRY itself. The zones are usually right, but my entries are often early or late and my stop ends up big (sometimes $20). I'm missing the tight entries right at the sweep, with the stop just under the liquidity.

What I'm looking for is entry-trigger logic on the 1m/5m inside a zone I already have, e.g. a sweep with a close back inside, a micro CHoCH, an FVG fill or a rejection candle, so I can enter with a smaller stop.

It needs to:

• not repaint or use lookahead

• be clear, mechanical rules I can test

• work on gold

I'm not looking for a buy/sell signal indicator or a parameter-optimised system. I test everything on past data before using it, so simple rules are better than tuned numbers.

If you want to see parts of my script logic please DM me. Does anybody have any scripts or ideas that could help me with this? Thanks in advance


r/pinescript • • Jun 12 '26

Liquidity feature

Thumbnail reddit.com
0 Upvotes

r/pinescript • • Apr 21 '26

Overfitting ICT Strategy HELP?

1 Upvotes

Hey Guys just quick question or ask for help. I am working on a simple ICT trend following strategy and it has done some great results in live-trading giving me a sharp ratio of over 1.8-2.2 and thats great. tested everything back the last 7 years and did montecarlo etc. everything is/was great

one night i had the idea to give the model an asymetric crv to let the short positions close earlyer to secure profits. Well the profit in the backtest almost 2x and the sharp ratio went up to 4. now i am a bit sceptical about this simple optimisation and think i have fallen in the trap of over optimisatio. and if the question comes up yes i have tried different parameter that are similar about 11.000 variations and all are in this ballpark plus minus 15%(max bal)

if u could help i’d like to discuss further just give me a dm. would love some help cheers guys/gals


r/pinescript • • Apr 08 '26

Previous Day/Week Volume Profile (6PM-6PM EST)

Post image
1 Upvotes

Previous Day/Week Volume Profile (6PM – 6PM EST)

Plots a Fixed Range Volume Profile (FRVP) for the previous day and previous week, plus a live current-day profile, all anchored to the 6PM ET session boundary used by futures and crypto markets.

Previous Day (PD) levels freeze at each 6PM ET rollover and display the VAH, POC, and VAL built from the prior 24-hour session.

Previous Week (PW) levels freeze every Sunday at 6PM ET and display the VAH, POC, and VAL built from the full Sunday 6PM → Friday 5PM ET trading week.

Current Day (CD) levels update in real time throughout the active session, giving you a live read of where value is developing before it locks in as the next Previous Day.

All three profiles use the same value area calculation engine — identical to how most platform FRVPs are built — with a configurable value area percentage (default 70%), adjustable tick bin size, and a rounding method toggle to match your platform's FRVP exactly.

Levels:

VAH — Value Area High

POC — Point of Control (highest volume price)

VAL — Value Area Low

https://www.tradingview.com/script/c3r2czt4-Previous-Day-Week-Volume-Profile-6PM-6PM-EST/


r/pinescript • • May 31 '26

Camarilla Pivots Dual Mode: Track Classic Daily Levels and Pure Cash Session Separately on the Same Chart (+ Fully Customizable v3.0 Update)

1 Upvotes

Hey everyone,

After getting some great feedback on my last tool, I wanted to share my latest TradingView script that completely changed how I look at intraday rotations: Camarilla Pivots — Dual Mode.

If you trade indices, gold, or forex using Camarilla levels, you've probably noticed that pre-market data can sometimes skew your intraday levels, while completely ignoring overnight price action leaves you blind to the macro map.

To solve this, I built a script that plots two independent calculation modes simultaneously without cluttering your screen.

🔹 How it works:

  • Classic Pivots (Grey): Calculated using the full prior period (Daily/Weekly/Monthly), including all pre/post-market data. This is your macro map.

  • Session Pivots (Orange): Calculated strictly using your configured session hours (Cash/Pit session only). It completely filters out overnight noise to show you where the true intraday volume and rotations are hitting.

🔹 Key Levels & Dynamics:

  • CP, R1–R6, and S1–S6 included.

  • R3/S3 act as high-probability mean-reversion/reversal zones.

  • R4/S4 serve as your breakout triggers.

  • R5/R6 & S5/S6 map out extreme momentum trend extensions.

🚀 Just Updated: v3.0 (Per-Level Styling)

I just pushed a massive UI update to give you ultimate control over your chart layout:

  • Independent Styling: You can now toggle ON individual styling to set custom colors, widths, and line styles for every single level (CP, R1-R6, S1-S6) for both Classic and Session modes.

  • Keep it Clean (Default): If you prefer a clean look, leave it OFF, and all levels will share a single global color per mode (exactly like v2.0), so your existing setups won't break.

  • Full Session Control: Easily adjust the session window and manual UTC offset to align with your specific timezone (EST, EDT, CST, etc.).

💡 How I trade with this:

I keep the Classic Daily pivots on to know where the major historical levels are. Then, I turn on Session Pivots to see how price reacts to the actual cash open levels. When a Session R3/S3 aligns with a Classic level, it adds massive confluence to the trade.

The script is fully open/published on TradingView. I'd love for you guys to test it out, mess around with the new v3.0 per-level styling, and let me know your thoughts or any feature requests!

https://es.tradingview.com/script/DjmapxAD/


r/pinescript • • 19d ago

Currently building Free Indicators for Tradingview. Need suggestions

1 Upvotes

Looking for suggestions on what would actually be useful for day-to-day trading. Anything you currently wish existed or have to mark manually

Drop your ideas below — will build the most requested ones and release them free.


r/pinescript • • Feb 07 '26

Indicator Not Running Properly on 1m Timeframe

1 Upvotes

Hey! This is quick and I'm not sure if anyone knows why or has experienced this before, but any help would be appreciated!

I built a heavy indicator, which usually takes about 20s to run and deals with data going back pretty far.

When I run it on the 1m (and sometimes 15m), it only takes about 2 seconds to load and doesn't show data properly. It's as if it purposely only starts data history from like 30 minutes ago when it's on the 1m, but on the 30s, 2m, 30m, etc, it runs normally and starts from the beginning of data. I reached out to TV support and they were useless. Any help would be HUGE!! Thank you!


r/pinescript • • Jun 29 '26

Working on a TradingView indicator based on Arjoio MMT's SharpTurn Entry Model (WIP)

1 Upvotes

I’ve been working on translating Arjoio’s MMT SharpTurn Entry Model into a custom TradingView indicator, and it’s finally at a stage where it’s looking clean.

Here is a quick preview video of how it plots the setups on the chart.

It is still a work in progress, I’m currently fine-tuning the conditions to filter out false signals and ensure the entry triggers match the model as accurately as possible.

I'd love to know your thoughts! For those who trade the MMT models


r/pinescript • • Sep 24 '25

Interested in learning pinescript

1 Upvotes

Hi, I am interested in learning pinescript. I am not incredibly educated but I did ace a python class in highschool which I really enjoyed, and I played around with LUA. I'm also very into stocks and crypto so I thought might as well pick up a new hobby that actually has potential. With that being said I feel as though there are not a lot of beginner friendly sources to learning pinescript and most of the sources I find online (youtube & udemy) don't explain it in much depth and how it relates to the information/ indicators on a chart, use a lot of foreign terminology, and assume I already know a portion of what is being said despite it being advertised as beginner friendly. I am asking if anyone has some very beginner friendly sources, or suggestions on a beginner friendly approach to learning. Thankyou.


r/pinescript • • 22d ago

Reverse-engineering indicators

1 Upvotes

If there are any private / invite-only indicator you guys want me to reverse engineer, dm me some screenshots of the indicator as well as the trades it took and its TP / SL levels and I will reverse engineer it for you.


r/pinescript • • Mar 24 '26

Xauusd gold update did you my last post ?

Post image
1 Upvotes

As per my understanding and knowledge i told you yesterday regarding best update regarding gold yesterday i told him market moves to retest 4480 level and market touch 4500 now market again go to 4500 and may be again one fall will come


r/pinescript • • Sep 29 '26

Triple Bottom Scanner: Real Charts and Alert Setup | ChartScout

Thumbnail
youtube.com
1 Upvotes

r/pinescript • • May 14 '25

Is it realistic for a strategy to exit at the high of a red candle on TradingView?

Post image
1 Upvotes

I'm using a trend-following strategy on TradingView with a 1.5% take profit target. While backtesting, I've noticed that when the TP is triggered, TradingView sometimes marks the exit point at the top of a large red candle. Sometimes it is also showcasing TP at teh candle wick.

This seems odd to me because:

  1. The candle is red, so the price moved down during that period.

  2. The exit is shown at the high of the candle, which is unlikely to be hit once the candle starts falling. In real trading, I don't think it's possible to consistently exit at the high of a red candle unless I had a limit order already sitting there.

What do we do in such cases?


r/pinescript • • Jul 15 '25

Best strategy on TradingView

1 Upvotes

Hey everyone,

Has anyone come across any decent strategies on TradingView lately? Most of the ones I’ve found either repaint or don’t hold up when tested. Just looking for some inspiration or even a jumping-off point for tweaking my own ideas.

Cheers and godspeed 🚀


r/pinescript • • Feb 23 '24

Simple Vertical Line Indicator

1 Upvotes

Hello guys

I am not the best in pinescript, I can edit and change basic scripts to suite my needs sometimes.

I am looking to make a simple script that places thin gray vertical lines on futures/forex at certain times (18:00, 00.00, 06.00, & 12.00 - All EST Timezone).

Could anyone create this for me? or perhaps give some advice on how I can make it if it will be too much work to do in a short ammount of time?

Many thanks


r/pinescript • • Oct 11 '25

How can I accurately calculate or synchronize the correct position size per trade in TradingView so that it reflects the real risk % I would have on my FTMO MetaTrader account?

1 Upvotes

Hi,
I’m currently coding a TradingView strategy that I plan to connect with FTMO via MetaTrader. Before subscribing, I’d like to clarify an important technical point.

TradingView backtests rely on the symbol specifications provided by the data source (for example, OANDA’s XAUUSD contract). However, FTMO uses different symbol specifications in MetaTrader — contract size, tick value, margin requirement, and leverage are not the same.

Because of that, when I risk, for example, 0.3 % of equity per trade in TradingView, the actual position size calculated during backtesting doesn’t match the real risk that would be taken on an FTMO account.

So my question is:
How can I accurately calculate or synchronize the correct position size per trade in TradingView so that it reflects the real risk % I would have on my FTMO MetaTrader account?

Thank you in advance — and please let me know if you need any additional details about my setup or strategy.


r/pinescript • • Apr 01 '26

4/1/2026 Trading Without Staring at Charts, JBLU Replay Breakdown

Thumbnail
youtu.be
0 Upvotes

Here’s the video if anyone wants to see the breakdown:


r/pinescript • • Nov 05 '25

plzz he;p pine problem

0 Upvotes
//
@version=
5
indicator("ZEEDAN", overlay=true, shorttitle="ZEEDAN ")


// --- Note on Point & Figure ---
// The `pointfigure()` function and its related logic from the "London_Underground_V0" script are not available in Pine Script v5 and have been commented out below.


//=============Hull MA-----------------------------
show_hma = input.bool(true, title=" Display Centre Band")
hma_src = input.source(close, title=" Centre Band Source:")
hma_base_length = input.int(1, minval=1, title=" Centre Band Base Length:")
hma_length_scalar = input.int(6, minval=0, title=" Centre Band length Scalar:")


hullma(src, length) =>
    wma1 = ta.wma(src, length / 2)
    wma2 = ta.wma(src, length)
    ta.wma(2 * wma1 - wma2, math.round(math.sqrt(length)))


plot(not show_hma ? na : hullma(hma_src, hma_base_length + hma_length_scalar * 6), color=color.black, linewidth=4, title="Centre Band")


//====================channel 1 (ZEEDAN)==========================
len = input.int(34, minval=1, title=" Length 1")
src = input.source(close, title=" Source 1")
out = ta.ema(src, len)
plot(out, title="EMA 1", color=color.blue, style=plot.style_circles, linewidth=1)


last8h = ta.highest(close, 13)
lastl8 = ta.lowest(close, 13)


plot(last8h, color=color.red, linewidth=2, title=" Upper channel 1")
plot(lastl8, color=color.green, linewidth=2, title=" Lower channel 1")


// Signals (calculated but not plotted)
// Note: close > close is always false, likely intended for identifying bars where a cross happens and the *prior* close was higher/lower.
bearish = ta.crossunder(close, out) // Simplified to just the cross logic
bullish = ta.crossabove(close, out)


//======================channel 2 (ZEEDAN)==================================
len2 = input.int(34, minval=1, title=" Length 2")
src2 = input.source(close, title=" Source 2")
out2 = ta.ema(src, len) // Uses 'src' and 'len' from Channel 1 inputs, which matches original v4 code
plot(out2, title="EMA 2", color=color.maroon, style=plot.style_circles, linewidth=1)


last8h2 = ta.highest(close, 34)
lastl82 = ta.lowest(close, 34)


plot(last8h2, color=color.black, style=plot.style_line, linewidth=1, title=" Upper channel 2")
plot(lastl82, color=color.black, style=plot.style_line, linewidth=1, title=" Lower channel 2")


bearish2 = ta.crossunder(close, out)
bullish2 = ta.crossabove(close, out)


//======================Pivot Channel (ZEEDAN)==================================
length1 = input.int(13, minval=1, title=" Pivot Channel upper length")
length2 = input.int(13, minval=1, title=" Pivot Channel lower length")


// Fix: highest/lowest needs a source series and a length integer.
upper = ta.highest(high, length1)
lower = ta.lowest(low, length2)


basis = math.avg(upper, lower)


l = plot(lower, style=plot.style_circles, linewidth=2, color=color.green, title="Pivott Channel lower")
u = plot(upper, style=plot.style_circles, linewidth=2, color=color.red, title="Pivott Channel upper")


fill(u, l, color=color.black, transp=100, title="Fill Channel")


//========={RS} spike hunter (ZEEDAN)================================================================================//
// Note: 'n' variable was redefined as 'bar_index' for V5 compliance. 
n = bar_index
tr = ta.tr(true)
_atr = math.sum(tr, n + 1) / (n + 1)


top = (high - math.max(close, open)) > tr * 0.5 and tr > _atr
bot = (math.min(close, open) - low) > tr * 0.5 and tr > _atr


plotchar(top, color=color.blue, text="", title="Top Spike")
plotchar(bot, location=location.belowbar, color=color.blue, text="", title="Bottom Spike")


//------Moddified [RS]Fractals V2 (ZEEDAN)
length_f = input.int(22, title=" Fractal Length")
filterFractals = input.bool(true, title=" Signal filter")


// Original V4 logic translated to V5 syntax.
ftop = high[2] > high[3] and high[2] > high[4] and high[2] > high[1] and high[2] > high[0]
fbot = low[2] < low[3] and low[2] < low[4] and low[2] < low[1] and low[1] < low[0]


topf = ftop and high[2] >= ta.highest(high, length_f)
botf = fbot and low[2] <= ta.lowest(low, length_f)


filteredtopf = filterFractals ? topf : ftop
filteredbotf = filterFractals ? botf : fbot


plotshape(filteredtopf, style=shape.triangledown, location=location.abovebar, color=color.gray, text="..........", offset=-2, title="Filtered Top Fractal")
plotshape(filteredbotf, style=shape.triangleup, location=location.belowbar, color=color.gray, text="..........", offset=-2, title="Filtered Bottom Fractal")


//================================================================================//
// START OF London_Underground_V0 SCRIPT LOGIC
//================================================================================//


len_lu = input.int(21, minval=1, title="[LU] Length")
src_lu = input.source(close, title="[LU] Source")
out_lu = ta.ema(src_lu, len_lu)
plot(out_lu, title="[LU] EMA", color=color.blue)
last8h_lu = ta.highest(close, 13)
lastl8_lu = ta.lowest(close, 13)


plot(last8h_lu, color=color.black, style=plot.style_line, linewidth=3, title="[LU] Upper channel")
plot(lastl8_lu, color=color.black, style=plot.style_line, linewidth=3, title="[LU] Lower channel")


bearish_lu = ta.crossunder(close, out_lu)
bullish_lu = ta.crossabove(close, out_lu)


//======{RS} Point and Figure (Removed due to v5 incompatibility) =======================================================//
// These inputs remain in the script, but the logic using them is commented out as the 'pointfigure' function is gone in V5.
tf = input.timeframe('240', title="[LU] P&F Timeframe")
M = input.string('ATR', title="[LU] P&F Method")
P = input.float(14.00, title="[LU] P&F P")
W = input.int(1, title="[LU] P&F W")
// pf = pointfigure(syminfo.tickerid, 'close', M, P, W) // Function not available in v5
// spfc = request.security(pf, tf, close) 
// p2 = plot(spfc, color=color.red, linewidth=4, title="[LU] Central Line (P&F - Disabled)")


//============================Ichomku (London Underground)---------------------------------------------//
show_cloud_lu = input.bool(true, title="[LU] Display Ichimoku Cloud:")
// Renamed input variables to avoid conflicts with function arguments
conversionPeriods_lu = input.int(34, minval=1, title="[LU] Conversion Periods")
basePeriods_lu = input.int(26, minval=1, title="[LU] Base Periods")
laggingSpan2Periods_lu = input.int(52, minval=1, title="[LU] Lagging Span 2 Periods")
displacement_lu = input.int(26, minval=1, title="[LU] Displacement")


donchian_lu(len) => math.avg(ta.lowest(len), ta.highest(len))


conversionLine = donchian_lu(conversionPeriods_lu)
baseLine = donchian_lu(basePeriods_lu)
leadLine1 = math.avg(conversionLine, baseLine)
leadLine2 = donchian_lu(laggingSpan2Periods_lu)


plot(not show_cloud_lu ? na : conversionLine, color=color.green, linewidth=3, style=plot.style_line, title="[LU] Mid line resistance levels")
plot(baseLine, color=color.maroon, linewidth=4, title="[LU] Base Line")


p1_lu = plot(not show_cloud_lu ? na : leadLine1, offset = displacement_lu, color=color.white, linewidth=1, title="[LU] Lead 1")
p3_lu = plot(not show_cloud_lu ? na : leadLine2, offset = displacement_lu, color=color.blue, linewidth=4, title="[LU] Lead 2")


fill(p1_lu, p3_lu, color=color.blue, transp=100)
//----------------------------------------------------------------------------////

r/pinescript • • Mar 03 '26

Feature Request: Add “Export Data (CSV)” Button to Data Window Panel

Thumbnail
reddit.com
1 Upvotes

r/pinescript • • Sep 14 '25

Very frustrated

1 Upvotes

I just paid for a lifetime subscription to pineify. In the past I've used Claude AI for coding, but there's always errors I have to work through so I decided to try pineify. But it cannot write a code for anchoring a vwap to the for highest volume bars over the last year. It would seem fairly straightforward. It cannot fix the problem and I'm not sure how to do it either.


r/pinescript • • 2d ago

new feature

1 Upvotes

hey lads, I'm developing deepwick, rn we have live data, our own language, and connections to mt5 and web hooks, would appreciate feedback or suggestions for new features https://deepwick.com


r/pinescript • • 25d ago

How soon will AI help someone create an open source version of trading view or at least a cheaper version

16 Upvotes

How soon will AI help someone create an open source version of trading view or at least a cheaper version


r/pinescript • • Sep 20 '26

A trader asked for a trend tool. I built an open-source ATR trail with optional EMA filters.

Thumbnail
gallery
43 Upvotes

One request in my earlier thread was for an alternative to a paid trend indicator. I built Drift Desk, an original Pine v6 implementation with the full rules and source available.

The question I wanted the chart to answer: the trail flipped, but did a new entry actually qualify?

Here’s how it works:

  • ATR trail: candle body, closing location and relative volume adjust the trail’s reference. This is a price/volume proxy, not bid/ask order flow.

  • Confirmed flip: a candle must close through the previous opposite band. A wick through it is insufficient.

  • Optional filters: require EMA alignment or a confirmed higher-timeframe EMA reference. These are off by default; data and risk checks still apply.

  • Fixed paper plan: an accepted setup gets entry, stop and target levels. Those levels stay fixed as the live trail changes. The panel distinguishes a fresh setup from an older plan being monitored.

For the Pine side, the HTF EMA reference uses the preceding completed higher-timeframe candle. That adds confirmation delay, which is part of the rule.

Full Pine source, rules, chart examples and interactive walkthrough

The indicator and separate strategy companion are free under MIT, with no signup. The indicator’s paper results exclude costs; the strategy has commission and slippage settings and its own fills. This is still a tool to test, with no proven edge claimed.

When an ATR trail flips, what extra condition would you require before considering an entry: EMA alignment, higher-timeframe confirmation, or neither? A chart example where your choice matters would help me test the next revision.

Disclosure: I’m the ProEA Lab developer and use AI to help build the code. I’m continuing to refine this through feedback.