Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

ICT Fair Value Gap

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • mazpat_3
    replied
    Originally posted by mazpat_3 View Post

    Here is a 5m chart with 15m fvgs + 2 autofibs

    Plots on each OTE levels would enable to create a strategy builder logic when price hits inside the zone (alert or limit order entry)

    On this example, price broke the bullish FVG to the downside with an MSS (signaling short term bearish reversal narrative).

    It should retrace back up to the bearish FVG above, somewhere inside the OTE, then bounce downwards...
    I forgot to mention the 70.5 retracement, which is the "CE" of any OTE .

    Plotting the FVGUp and FVGDown CEs would also be a nice addition.

    On my second screenshot, 15m FVG CEs often coincides with 0.5, 0.618, or 0.705 of the last swing H/L on the 5m chart
    Attached Files

    Leave a comment:


  • mazpat_3
    replied
    Originally posted by tickets2themoon View Post

    Can you chart an example using this indicator and apply a Fib Retracement drawing where you would like to see it? Should be fairly simple to code. Would probably make sense to create a different indicator iteration/name and have gemify post it.
    Here is a 5m chart with 15m fvgs + 2 autofibs

    Plots on each OTE levels would enable to create a strategy builder logic when price hits inside the zone (alert or limit order entry)

    On this example, price broke the bullish FVG to the downside with an MSS (signaling short term bearish reversal narrative).

    It should retrace back up to the bearish FVG above, somewhere inside the OTE, then bounce downwards...
    Attached Files
    Last edited by mazpat_3; 03-08-2023, 12:47 PM.

    Leave a comment:


  • tickets2themoon
    replied
    Originally posted by mazpat_3 View Post
    This is a killer. And I'm thinking of a little addition that could propel this very far, maybe as an option to toggle on/off. Do you think you could add fib plots to anchor to the swing high/low of the displacement?

    A plot at 0.5, 0.618, 0.705, 0.79 and 0.886 of any displacement would permit the creation of alerts, signals and therefore, a strategy! Here is the opensource code for the autofib portion:search this on the user app share ecosystem TcFAutoFibos - NinjaTrader Ecosystem

    Let me know if this feature request speaks to you. And this is a call to participation from the thread participants of course. I just wish I could code like you guys Thanks again for being open-source minded!​
    Can you chart an example using this indicator and apply a Fib Retracement drawing where you would like to see it? Should be fairly simple to code. Would probably make sense to create a different indicator iteration/name and have gemify post it.

    Leave a comment:


  • mazpat_3
    replied
    This is a killer. And I'm thinking of a little addition that could propel this very far, maybe as an option to toggle on/off. Do you think you could add fib plots to anchor to the swing high/low of the displacement?

    A plot at 0.5, 0.618, 0.705, 0.79 and 0.886 of any displacement would permit the creation of alerts, signals and therefore, a strategy! Here is the opensource code for the autofib portion:search this on the user app share ecosystem TcFAutoFibos - NinjaTrader Ecosystem

    Let me know if this feature request speaks to you. And this is a call to participation from the thread participants of course. I just wish I could code like you guys Thanks again for being open-source minded!​
    Last edited by mazpat_3; 03-06-2023, 09:49 PM.

    Leave a comment:


  • tickets2themoon
    replied
    gemify
    Thinking through the code - in CheckFilledFVGs() we may want to always remove the item from fvgList once filled. We are skipping doing any processing in the initial fvgList loop once fvg.filled = true so there is no reason to keep the item in the list.

    Code:
                    if (HideFilledGaps)
                    {
                        fvgList.Remove(fvg);
                    }​
    
    can probably change to just:
    
                    fvgList.Remove(fvg);

    Leave a comment:


  • sdhansma
    replied
    This indicator is great! If you are looking for any suggestions....I have a few:
    1. Allow the GAP to be painted to a set number of bars instead of the enter screen
    2. Allow for the FVG to be deleted if it is touched...rather then just traded through
    3. Provide a chart button to toggle on and off the gaps (to have a cleaner chart
    Thanks again for all your work its fantastic!

    Leave a comment:


  • Neeraj838
    replied
    hi, if i enable consequent encroachment on a 1 min chart, it slows down Ninjatrader substantially for me. Once i disable it, then it functions smoothly. Just wanted to check if anyone else having this issue?

    Leave a comment:


  • dj22522
    replied
    As an update to my last post 60.

    Yesterdays NT8 UM numbers :-
    CandleStick Chart Style (CCS) = 290,000
    ICTFVG v0.0.2.2 = 4360​

    Today and also running about 8 hours:-
    CandleStick Chart Style (CCS) = 32,000
    ICTFVG v0.0.2.2 = 415

    Overall todays numbers are much lower. I've no idea why for CCS not that there's anything wrong. Perhaps the rate of price changes seeing as there will always be the same number of candlestick per day for what ever chart time period selected.

    Regardless. Yesterdays ICTFVG was about 1.5 % of the CCS numbers and today about 1.3 % of the CCS.

    Todays ICTFVG I used the code change kindly posted by tickets2themoon in post 58 which reduced the rectangles future plot length to the right of the chart.

    Both versions resource usages are so far below the benchmark CCS that I'm not sure NT8 even knows the indicator's running (lol).

    Non the less tickets2themoon code change reduces even more resource usage which can never be a bad thing assuming anyone reading this is mindful of NT8 resource issues.

    To add. I was running one chart with 4 tabs with each chart set to 2000 Bars rather than Days and two instances of ICTFVG on each chart.

    Hope this was of some use. I have very little scripting skills and as all the wonderful work done for this indicator is way beyond my skill set this is the least I can do to help in any way.

    Many thx to both gemify and ticketstothemoon
    Last edited by dj22522; 03-02-2023, 02:36 PM.

    Leave a comment:


  • dj22522
    replied
    tickets2themoon. Thank you for the code in post 58.

    I will try that tomorrow to see if and how it might affect the resources.

    I'm using the NT Utilization Monitor and compare an indicator to the NT Candlestick Chart Style to gauge how intensive an indicators use is.

    Anything that remains below the CandleStick Chart Style is, as far as I understand this, a good measure of how well it's scripts been written.


    For todays session of approx 8 hours use the NT CandleStick Chart Style used 279,000 compared to the ICTFVG v0.0.2.2 which used 4,360. I had the indicator loaded twice on each of 4 charts (tabs) but I think the utilization refers to only when any (one) chart is active.

    So the ICTFVG is extremely efficient. All credit to it's creator.

    I'll change the code as per post 58 and post those Utilization numbers tomorrow for comparison.

    Hope this helps.
    Last edited by dj22522; 03-02-2023, 04:01 AM.

    Leave a comment:


  • tickets2themoon
    replied
    Originally posted by dj22522 View Post
    gemify and tickets2themoon

    As an aside and just thinking out loud:-
    You can only execute AddDataSeries during configure State of the indicator. So there is not a quicker method to modify that series that editing the indicator settings.

    You could add a checkbox for enabling the secondary data series. If disabled you would use primary data series. This option would toggle an integer "iDataSeries" from 0 to 1 which could be used in references to time or price data.(ie. Times[1][0] would change to Times[iDataSeries][0], Closes[iDataSeries][0], etc.

    That should work.


    After more thought it may be possible to add a static object that when clicked switched FVGs between primary and secondary data series...
    Last edited by tickets2themoon; 03-01-2023, 10:24 AM.

    Leave a comment:


  • tickets2themoon
    replied
    Originally posted by dj22522 View Post
    tickets2themoon

    Thank you for post 54.
    This unfortunately created issues (?)

    Many thx
    Nice colors??! Not sure where that came from.

    Post 54 was only a partial modification to CheckFilledFVGs method.
    Here is my entire method. I'm not experiencing any issues:

    Code:
           private void CheckFilledFVGs()
            {
                List<FVG> filled = new List<FVG>();
    
                foreach (FVG fvg in fvgList)
                {
                    if (fvg.filled) continue;
    
                    if (DrawObjects[fvg.tag] != null && DrawObjects[fvg.tag] is DrawingTools.Rectangle)
                    {
                        //Update EndAnchor of Gap to Expand into future.
                        Rectangle gapRect = (Rectangle)DrawObjects[fvg.tag];
                        gapRect.EndAnchor.Time = Times[1][0].AddDays(ChartBars.Properties.DaysBack);
    
                        if (DisplayCE && DrawObjects[fvg.tag + "_CE"] != null && DrawObjects[fvg.tag + "_CE"] is DrawingTools.Line)
                        {
                            DrawingTools.Line gapLine = (DrawingTools.Line)DrawObjects[fvg.tag + "_CE"];
                            gapLine.EndAnchor.Time = Times[1][0].AddDays(ChartBars.Properties.DaysBack);
                        }
    
                    }
    
                    if (fvg.type == FVGType.R && (FillType == FVGFillType.CLOSE_THROUGH ? (Closes[1][0] >= fvg.upperPrice) : (Highs[1][0] >= fvg.upperPrice)))
                    {
                        if (DrawObjects[fvg.tag] != null)
                        {
                            fvg.filled = true;
                            fvg.fillTime = Times[1][0];
                            filled.Add(fvg);
                        }
                    }
                    else if (fvg.type == FVGType.S && (FillType == FVGFillType.CLOSE_THROUGH ? (Closes[1][0] <= fvg.lowerPrice) : (Lows[1][0] <= fvg.lowerPrice)))
                    {
                        if (DrawObjects[fvg.tag] != null)
                        {
                            fvg.filled = true;
                            fvg.fillTime = Times[1][0];
                            filled.Add(fvg);
                        }
                    }
                }
    
                foreach (FVG fvg in filled)
                {
                    if (DrawObjects[fvg.tag] != null)
                    {
                        var drawObject = DrawObjects[fvg.tag];
                        Rectangle rect = (Rectangle)drawObject;
    
                        RemoveDrawObject(fvg.tag);
                        RemoveDrawObject(fvg.tag + "_CE");
    
                        if (!HideFilledGaps)
                        {
                            Brush BorderBrush = fvg.type == FVGType.R ? DownBrush : UpBrush;
                            rect = Draw.Rectangle(this, "FILLED" + fvg.tag, false, fvg.gapStartTime, fvg.lowerPrice, Times[1][0], fvg.upperPrice, BorderBrush, FillBrush, FilledAreaOpacity, true);
                            rect.OutlineStroke.Opacity = Math.Min(100, FilledAreaOpacity * 4);
                        }
                    }
                    if (HideFilledGaps)
                    {
                        fvgList.Remove(fvg);
                    }
                }
            }​

    Leave a comment:


  • dj22522
    replied
    gemify and tickets2themoon

    As an aside and just thinking out loud:-

    ICTFVG v 0.0.1.0 meant the FVG's would display for that chart increment.
    ie: For a 1 min chart FVG's would display for that 1min chart.
    Then if we were to change the chart increment (top left of chart drop down) to say a 5min chart then the FVG's would automatically display for that 5 min chart. Lets call these "Fixed" FVG's.

    ICTFVG v0.0.2.2 gives us additional data series meaning we can set the Time increment within the indicator settings.
    ie: For a 1 min chart if we select the Time in the indicator settings to 1 min we get 1 min FVG's on our 1 min chart. (same display as Fixed) Which is all fine and good. We can also set the Time as 3 min for our 1 min chart and get 3 min FGV's displayed on our 1 min chart.
    Lets call these "Variable" FVG's.

    If however we were to change the chart increment to say 5 min, we then need to go into indicator settings to change the Time from 1 min to 5 min to get FVG's for our 5 min chart other wise we will have 1 min FVG's displayed on our 5 min chart.


    I understand this is the point of the v0.0.2.2 by adding ability for other data series but, and forgive my coding skill ignorance here, is there a way to have the Fixed FVG function from v0.0.1.0 and Variable FVG v0.0.2.2 at the same time ?

    Meaning the multi data series facility of v0.0.2.2 helps by not having to load separate data series to a chart, but it means I can't change between chart time frames on the fly without then needing to go in to indicator settings to then change the Time increments for the FVG's.

    Am I answering my own question by saying I can run an increment of a "Fixed" FVG v0.0.1.0 and add the indicator a 2nd and even 3rd time with "Variable" v0.0.2.2 ?

    If so how do I do that when each new version over writes the previous one when Importing.

    Or is having multiple chart Tabs with each chart time frame and ICTFVG Time increment set up as required the only alternative ?


    As mentioned, I'm just thinking out loud and as also mentioned I'm new to this ICT methodology so I'm not experienced enough to know if or how FVG's are valid or usable yet over what ever time increments and or settings.


    Many thx
    Last edited by dj22522; 03-01-2023, 05:00 AM.

    Leave a comment:


  • dj22522
    replied
    tickets2themoon

    Thank you for post 54.
    This unfortunately created issues (?)

    Click image for larger version

Name:	FVG -a .jpg
Views:	1085
Size:	186.4 KB
ID:	1237375

    Many thx

    Leave a comment:


  • tickets2themoon
    replied
    gemify
    You can also define FVGPeriodTypes using the values from BarsPeriodType. One advantage is custom BarTypes could be added by users like the the MinuteOpen BarType I wrote:
    Code:
    // Supported period types for FVG detection
    public enum FVGPeriodTypes
    {
    Tick = BarsPeriodType.Tick,
    Volume = BarsPeriodType.Volume,
    Second = BarsPeriodType.Second,
    Minute = BarsPeriodType.Minute,
    MinuteOpen = 1026,
    Day = BarsPeriodType.Day,
    Week = BarsPeriodType.Week,
    Month = BarsPeriodType.Month,
    Year = BarsPeriodType.Year
    }​


    The AddDataSeries looks like the following, eliminating the enum parsing:

    Code:
    AddDataSeries((BarsPeriodType)FVGBarsPeriodType, FVGSeriesPeriod);

    Leave a comment:


  • tickets2themoon
    replied
    dj22522
    I'm not sure. I don't think the chart will let you scroll forward more than a few hours on a minute chart but on a daily chart you can scroll forward for more than a year.

    I remember seeing below line from OnRender method in @Regions.cs but that is probably because it is performing vector geometrical calculations.
    // Now cap start/end by visibly painted bars!
    // If you dont do this it will absolutely crush performance on larger regions

    I still think it may be best to update the EndAnchor in the CheckFilledGaps() method so you don't have to draw it so large initially:

    Code:
    private void CheckFilledFVGs()
    {
    List<FVG> filled = new List<FVG>();
    
    foreach (FVG fvg in fvgList)
    {
    if (fvg.filled) continue;
    
    if (DrawObjects[fvg.tag] != null && DrawObjects[fvg.tag] is DrawingTools.Rectangle)
    {
    //Update EndAnchor of Gap to Expand into future.
    Rectangle gapRect = (Rectangle)DrawObjects[fvg.tag];
    gapRect.EndAnchor.Time = Times[1][0].AddDays(ChartBars.Properties.DaysBack);
    
    if (DisplayCE && DrawObjects[fvg.tag + "_CE"] != null && DrawObjects[fvg.tag + "_CE"] is DrawingTools.Line)
    {
    DrawingTools.Line gapLine = (DrawingTools.Line)DrawObjects[fvg.tag + "_CE"];
    gapLine.EndAnchor.Time = Times[1][0].AddDays(ChartBars.Properties.DaysBack);
    }
    
    }​

    Last edited by tickets2themoon; 02-28-2023, 06:29 PM.

    Leave a comment:

Latest Posts

Collapse

Topics Statistics Last Post
Started by CaptainJack, 05-29-2026, 05:09 AM
0 responses
414 views
0 likes
Last Post CaptainJack  
Started by CaptainJack, 05-29-2026, 12:02 AM
0 responses
275 views
0 likes
Last Post CaptainJack  
Started by charlesugo_1, 05-26-2026, 05:03 PM
0 responses
235 views
1 like
Last Post charlesugo_1  
Started by DannyP96, 05-18-2026, 02:38 PM
1 response
322 views
0 likes
Last Post NinjaTrader_ChelseaB  
Started by CarlTrading, 05-11-2026, 05:56 AM
0 responses
280 views
0 likes
Last Post CarlTrading  
Working...
X