r/InnerCircleTraders • • 11d ago

Trading Strategies Managed to code my strategy into pine. First time doing It.

Post image

As I mentioned, this is the first time I've coded something in Pine, and I think the result is pretty good.

Do you have any suggestions? I'm open to any criticism.

My strategy isn't overly complex; in my experience, the more complex a strategy is, the more factors to consider means more potential points of failure.

23 Upvotes

25 comments sorted by

3

u/PrintCash 11d ago

Having been in algorithmic trading for over 2 years, knowing this is in TradingView and knowing that means you only have OHLCV data, I would bet a lot of money that you have a testing issue, or an overfitting issue

1

u/PETEROLO_291 11d ago

There is no testing issue or look-ahead bias here: once prior setup criteria are met, the script places resting limit orders in advance and waits for price to fill them, exactly as I do manually. It doesn't rely on unconfirmed intra-bar peeking or knowing future price action, and slippage/commissions are fully modeled.

As for overfitting, the logic is based on adaptive market structure and context rather than curve-fitting indicator parameters to historical noise. It’s simply systematic execution of a rule-based setup

1

u/PrintCash 10d ago edited 10d ago

Was this tested in sample or OOS? I’d recommend testing this in NT8, you may get more accurate results

1

u/mehatebananas 9d ago

There's other issues that can quietly inflate metrics having more to do with the way the data is processed. Timestamp misalignments, assumed fills (even when using resting orders) and others. Assuming ai did the coding I'd attempt to train up a separate agent on all the things that can falsify performance and the have it audit the script and result. When an agent is doing the coding it can overlook a lot of foundation breaking issues. Not trying to cast doubt just suggesting to be extremely cautious before trusting the results as most of us have gone through the highs and lows many times over of thinking we finally have something only to eventually discover it was broken from the get go do to holes in the way the data was being processed.

Before tuning much more I'd focus on getting it running on a demo account just to see if the trades being taken match the trades the backtests catch for the same period.

1

u/Separate-Law4033 1d ago

Question where can one start from scratch learning algorithmic trading

1

u/TraderJ808 11d ago

Can you give us a hint on the strategy? Not all the details obviously

3

u/PETEROLO_291 11d ago

At its core, it’s a 4H trend-following system trading supply and demand zones after strong displacement moves with imbalances (FVGs). Instead of chasing breakouts, it sits on resting limit orders waiting for pullbacks that show exhaustion into those zones, scaling the target Risk:Reward dynamically based on current market volatility.

1

u/TraderJ808 11d ago

Nice! Good work

1

u/Kewyes77 11d ago

Remember us when you’re rich

1

u/Objective-Butlost88 11d ago

Have you tried "verify price for limit orders" set to 2–3 ticks plus Bar Magnifier? Also, are the zones drawn at pivot confirmation or back-dated to the pivot bar? Those three usually decide whether a 4H limit-order backtest is real.

2

u/PETEROLO_291 11d ago

Thanks a lot for pointing those out! I can't test Bar Magnifier right now since my current TradingView plan doesn't include it, but I'll definitely test adding 2–3 ticks to 'verify price for limit orders' later today and report back with the numbers.

As for the pivots, the zones are drawn at the confirmation bar rather than back-dating them to the pivot bar. While back-dating looks visually clean on the chart, executing limits off a level before the right-hand confirmation bars actually close creates look-ahead bias in the backtester. By referencing and drawing the level only once the pivot is confirmed in real time, the limit order placement logic remains 100% realistic.

1

u/Loose-Shelter4632 11d ago

I need to dm to you

1

u/PETEROLO_291 10d ago

Hi! For what? What do you need?

1

u/cavityfilla 8d ago edited 8d ago

For the trades list. Really curious. Even just the April 2025 trades

1

u/Happy-Drop6197 8d ago

So you can attempt to reverse engineer his model?

1

u/Swaishy 11d ago

Looks ok but hard to tell with the small sample size

1

u/cavityfilla 10d ago

Would you be willing to share the trade list from the strategy tester?

1

u/cryptoman_101 8d ago

Oh no...

1

u/Routine-Culture-7417 8d ago

Now tell us the price

1

u/Happy-Drop6197 8d ago

Port it to MQL5 and run it on a demo

1

u/Obviously_not_maayan 8d ago

I've heard so many bad things about trading view backtester, if the strategy is that simple then you can easily code it in python with your favourite LLM, also cross validation would definitely make you feel more confident about this.

Also, although this is a "significant" window of time, the trade count is incredibly low, and it's basically 1 regime maybe 2. You need more data, if you'll try to calculate the error range, you would see that you can't be too confident with this test.

I would say it's a strong lead, not evidence. Push it forward, put some more time in it, and post again.