TradingView
toodegrees
22 Apr 2023 pukul 13.00

Simple ICT Market Structure by toodegrees 

E-mini S&P 500 FuturesCME

Deskripsi

This Simple ICT Market Structure is based on the teachings of ICT, specifically in his episode 12 of the Public 2022 Mentorship.

The only omission here is the peculiar calculation of Intermediate Term points, for which I am not using the concept of repricing imbalances – this can be added later!

Feel free to use this tool, however it is quite simple and market structure is something we all know very well how to spot. In my opinion it is helpful to display the long term swing points to identify more mature pools of liquidity.

The reason for coding this tool is to help new coders understand PineScript (I have a video tutorial where I code this from start to finish), as well as fostering some algorithmic thinking in your trading of ICT Concepts and Algorithmic Delivery.

If you have any questions about the code, shoot me a message!

Hope you learn something and GLGT!

Catatan Rilis

Update: added color option for labels for dark background users:
Komentar
mordinlehnert
is it possible to change the script so I can have it paint based on a chosen timeframe. so when I go down the timeframes I will see the high/lows of the timeframe I picked?
Remote-Trading
@mordinlehnert, I would really appreciated this feature too. Do you think you can add this @toodegrees?
scutarasu
hi
is reprinted ?
toodegrees
@scutarasu, It does not repaint!
geester
Hey buddy, I like what you have done here. I'm a coder but I haven't used Pine before so your example is very helpful. I just wanted to check with you on the overall approach. Short-term high is effectively, a three-bar fractal where the middle bar is the highest of the three. Your Intermediate-term high is a Short-term high with a lower Short-term high to its left and right. The Long-term high is where you have a lower Intermediate-term high to its left and right. I have another question but, I'll ask if you are able to confirm my assumptions! Cheers!
toodegrees
@geester, you are indeed correct!
geester
@toodegrees, Ah cool. Thanks for confirming! I think you mentioned the rebalancing issue. In video 12 ICT suggests that the high/low that mitigates the FVG imbalance is by default an intermediate high/low. You couldn't pick up on this unless you added code that detected the various types of FVGs. I've been coding up an FVG tool in MT4/5. I was thinking of creating the intermediate high with its surrounding short-term highs from the perspective of the FVG objects and then, fan out from there picking up the rest of the routine short/intermediate/long-term highs. This FVG/Intermediate high/low link is an edge case and it's hard to accommodate it unless you account for it in the first place. I like the look of PineScript but, there are some really obvious limitations with it. It's like Javascript but, modern Javascript has a really good OOP-based story that is just missing from Pine (to keep it relatively simple). Obviously, this restricts what you can do. On saying that, by comparison, it takes a ton of code in MQL4/5 to do some things that in Pine seem trivial. I guess it's just down to the complexity of the requirement.
toodegrees
@geester, I did talk about the rebalancing mentioned in video 12 in the code walkthrough I recorded for this. I have all the elements to achieve it, I just haven't had the Time to sit down and implement it. The trick I use in Pine is to work backwards. I "forget" some of the CS knowledge I have and think about the problem from an ICT trader's perspective, when I get stuck I look at my CS toolbox. This said, Pine does have a lot more to offer than you think, including OOP – sometimes it's handy to use drawings, such as labels here, but I use OOP in my more complex scripts most of which are not published. The biggest limitation in my eyes is libraries; however with Time I am finding a lot of work from talented coders who built unimaginable libraries for Pine. I have been coding in Pine for some time – apart from Python for some data work, I wouldn't personally use anything else. If you need some help DM on here!
geester
@toodegrees, yes, I know you did mention the rebalancing in your video. When you say work backwards, you mean from newest to oldest bars? That's how you work in MT4/5 using bar arrays as time series where bar 0 is always the latest bar and everything shuffles backwards when the new bar opens. Interesting what you say about Pine doing OOP. I couldn't see that it offers the ability to create classes or class-based inheritance although it does treat certain things in an object-like way. I'd be keen to learn more about Pine because TV really is a popular platform. Thanks for responding and I appreciate the offer of help via DM. Cheers buddy!
toodegrees
@geester, My pleasure!
Lebih lanjut