Announcement
Collapse
No announcement yet.
Partner 728x90
Collapse
NinjaTrader
ICT Fair Value Gap
Collapse
X
-
I have this code for my strategy but whenever I try to reference the FVGlist ( I see the FVGs on the chart) the list is empty....what am I doing wrong?Code:#region Using declarations using System; using System.Collections.Generic; using System.ComponentModel; using System.ComponentModel.DataAnnotations; using System.Linq; using System.Text; using System.Threading.Tasks; using System.Windows; using System.Windows.Input; using System.Windows.Media; using System.Xml.Serialization; using NinjaTrader.Cbi; using NinjaTrader.Gui; using NinjaTrader.Gui.Chart; using NinjaTrader.Gui.SuperDom; using NinjaTrader.Gui.Tools; using NinjaTrader.Data; using NinjaTrader.NinjaScript; using NinjaTrader.Core.FloatingPoint; using NinjaTrader.NinjaScript.Indicators; using NinjaTrader.NinjaScript.DrawingTools; using NinjaTrader.NinjaScript.Indicators.Gemify; #endregion //This namespace holds Strategies in this folder and is required. Do not change it. namespace NinjaTrader.NinjaScript.Strategies { public class test : Strategy { private int Var; private NinjaTrader.NinjaScript.Indicators.Gemify.ICTFVG ICTFVG1; private ICTFVG fvgIndicator; protected override void OnStateChange() { if (State == State.SetDefaults) { Description = @"Enter the description for your new custom Strategy here."; Name = "test"; Calculate = Calculate.OnBarClose; EntriesPerDirection = 1; EntryHandling = EntryHandling.AllEntries; IsExitOnSessionCloseStrategy = true; ExitOnSessionCloseSeconds = 30; IsFillLimitOnTouch = true; MaximumBarsLookBack = MaximumBarsLookBack.TwoHundredFiftySix; OrderFillResolution = OrderFillResolution.Standard; Slippage = 0; StartBehavior = StartBehavior.WaitUntilFlat; TimeInForce = TimeInForce.Gtc; TraceOrders = false; RealtimeErrorHandling = RealtimeErrorHandling.StopCancelClose; StopTargetHandling = StopTargetHandling.PerEntryExecution; BarsRequiredToTrade = 40; // Disable this property for performance gains in Strategy Analyzer optimizations // See the Help Guide for additional information IsInstantiatedOnEachOptimizationIteration = true; Parameter = 1; Var = 1; } else if (State == State.Configure) { AddDataSeries("ES 09-23", Data.BarsPeriodType.Minute, 5, Data.MarketDataType.Last); } else if (State == State.DataLoaded) { ICTFVG1 = ICTFVG(Close, true, NinjaTrader.NinjaScript.Indicators.Gemify.FVGPeriodTypes.Minute, 5, 1000, true, 10, 1.1, 0.01, NinjaTrader.NinjaScript.Indicators.Gemify.FVGFillType.CLOSE_THROUGH, true, false, Brushes.Maroon, Brushes.Maroon, Brushes.DarkGreen, Brushes.DarkGreen, 13, 4, true, NinjaTrader.NinjaScript.DrawingTools.TextPosition.TopRight, new SimpleFont("Verdana", 12) {Bold = false, Italic = false}, Brushes.WhiteSmoke, Brushes.DimGray, Brushes.Blue, 50); fvgIndicator = ICTFVG(Close, true, NinjaTrader.NinjaScript.Indicators.Gemify.FVGPeriodTypes.Minute, 5, 1000, true, 10, 1.1, 0.01, NinjaTrader.NinjaScript.Indicators.Gemify.FVGFillType.CLOSE_THROUGH, true, false, Brushes.Maroon, Brushes.Maroon, Brushes.DarkGreen, Brushes.DarkGreen, 13, 4, true, NinjaTrader.NinjaScript.DrawingTools.TextPosition.TopRight, new SimpleFont("Verdana", 12) { Bold = false, Italic = false }, Brushes.WhiteSmoke, Brushes.DimGray, Brushes.Blue, 50); SetTrailStop(@"5", CalculationMode.Percent, 0, false); SetProfitTarget(@"20", CalculationMode.Ticks, 0); } } protected override void OnBarUpdate() { // Check for FVG conditions and implement your strategy logic here if (fvgIndicator != null && fvgIndicator.FVGList.Count > 0) { // Access FVG data and information using fvgIndicator.FVGList // Implement your trading logic based on the detected FVGs // For example, you can enter long or short positions when specific FVG conditions are met. } } #region Properties [NinjaScriptProperty] [Range(1, int.MaxValue)] [Display(Name="Parameter", Order=1, GroupName="Parameters")] public int Parameter { get; set; } #endregion } }
Comment
-
gemify Great indicator and I use it everday. Trying to extract values of FVG from chart using ChartToCSV and its not capturing the values. Is it possible to make it work? Thanks,This indicator will write all of the chart’s historical bar data and indicator data to a CSV type file that can then be imported into a spreadsheet. To use this indicator, add it to a chart and (critical) wait until all indicators have finished reloading (no longer shows (Calculating…)). Click the green button in the […]
Comment
-
The List fvgList is currently set to private. You can attempt to change the code and modify the list to be public on line 76:Originally posted by sierrajpr View PostI have this code for my strategy but whenever I try to reference the FVGlist ( I see the FVGs on the chart) the list is empty....what am I doing wrong?
Then you should be able to access the list using fvgIndicator.fvgListCode:public List<FVG> fvgList = new List<FVG>();
Comment
-
using the above code as a starting point, how would one go about checking to see if a FVG was just created on the most recently closed bar? Is there a better way then checking the fvgList?Originally posted by sierrajpr View PostI have this code for my strategy but whenever I try to reference the FVGlist ( I see the FVGs on the chart) the list is empty....what am I doing wrong?Code:#region Using declarations using System; using System.Collections.Generic; using System.ComponentModel; using System.ComponentModel.DataAnnotations; using System.Linq; using System.Text; using System.Threading.Tasks; using System.Windows; using System.Windows.Input; using System.Windows.Media; using System.Xml.Serialization; using NinjaTrader.Cbi; using NinjaTrader.Gui; using NinjaTrader.Gui.Chart; using NinjaTrader.Gui.SuperDom; using NinjaTrader.Gui.Tools; using NinjaTrader.Data; using NinjaTrader.NinjaScript; using NinjaTrader.Core.FloatingPoint; using NinjaTrader.NinjaScript.Indicators; using NinjaTrader.NinjaScript.DrawingTools; using NinjaTrader.NinjaScript.Indicators.Gemify; #endregion //This namespace holds Strategies in this folder and is required. Do not change it. namespace NinjaTrader.NinjaScript.Strategies { public class test : Strategy { private int Var; private NinjaTrader.NinjaScript.Indicators.Gemify.ICTFVG ICTFVG1; private ICTFVG fvgIndicator; protected override void OnStateChange() { if (State == State.SetDefaults) { Description = @"Enter the description for your new custom Strategy here."; Name = "test"; Calculate = Calculate.OnBarClose; EntriesPerDirection = 1; EntryHandling = EntryHandling.AllEntries; IsExitOnSessionCloseStrategy = true; ExitOnSessionCloseSeconds = 30; IsFillLimitOnTouch = true; MaximumBarsLookBack = MaximumBarsLookBack.TwoHundredFiftySix; OrderFillResolution = OrderFillResolution.Standard; Slippage = 0; StartBehavior = StartBehavior.WaitUntilFlat; TimeInForce = TimeInForce.Gtc; TraceOrders = false; RealtimeErrorHandling = RealtimeErrorHandling.StopCancelClose; StopTargetHandling = StopTargetHandling.PerEntryExecution; BarsRequiredToTrade = 40; // Disable this property for performance gains in Strategy Analyzer optimizations // See the Help Guide for additional information IsInstantiatedOnEachOptimizationIteration = true; Parameter = 1; Var = 1; } else if (State == State.Configure) { AddDataSeries("ES 09-23", Data.BarsPeriodType.Minute, 5, Data.MarketDataType.Last); } else if (State == State.DataLoaded) { ICTFVG1 = ICTFVG(Close, true, NinjaTrader.NinjaScript.Indicators.Gemify.FVGPeriodTypes.Minute, 5, 1000, true, 10, 1.1, 0.01, NinjaTrader.NinjaScript.Indicators.Gemify.FVGFillType.CLOSE_THROUGH, true, false, Brushes.Maroon, Brushes.Maroon, Brushes.DarkGreen, Brushes.DarkGreen, 13, 4, true, NinjaTrader.NinjaScript.DrawingTools.TextPosition.TopRight, new SimpleFont("Verdana", 12) {Bold = false, Italic = false}, Brushes.WhiteSmoke, Brushes.DimGray, Brushes.Blue, 50); fvgIndicator = ICTFVG(Close, true, NinjaTrader.NinjaScript.Indicators.Gemify.FVGPeriodTypes.Minute, 5, 1000, true, 10, 1.1, 0.01, NinjaTrader.NinjaScript.Indicators.Gemify.FVGFillType.CLOSE_THROUGH, true, false, Brushes.Maroon, Brushes.Maroon, Brushes.DarkGreen, Brushes.DarkGreen, 13, 4, true, NinjaTrader.NinjaScript.DrawingTools.TextPosition.TopRight, new SimpleFont("Verdana", 12) { Bold = false, Italic = false }, Brushes.WhiteSmoke, Brushes.DimGray, Brushes.Blue, 50); SetTrailStop(@"5", CalculationMode.Percent, 0, false); SetProfitTarget(@"20", CalculationMode.Ticks, 0); } } protected override void OnBarUpdate() { // Check for FVG conditions and implement your strategy logic here if (fvgIndicator != null && fvgIndicator.FVGList.Count > 0) { // Access FVG data and information using fvgIndicator.FVGList // Implement your trading logic based on the detected FVGs // For example, you can enter long or short positions when specific FVG conditions are met. } } #region Properties [NinjaScriptProperty] [Range(1, int.MaxValue)] [Display(Name="Parameter", Order=1, GroupName="Parameters")] public int Parameter { get; set; } #endregion } }
Comment
-
Can you share an updated strategy how you implemented and accessed list?Originally posted by sierrajpr View PostI have this code for my strategy but whenever I try to reference the FVGlist ( I see the FVGs on the chart) the list is empty....what am I doing wrong?Code:#region Using declarations using System; using System.Collections.Generic; using System.ComponentModel; using System.ComponentModel.DataAnnotations; using System.Linq; using System.Text; using System.Threading.Tasks; using System.Windows; using System.Windows.Input; using System.Windows.Media; using System.Xml.Serialization; using NinjaTrader.Cbi; using NinjaTrader.Gui; using NinjaTrader.Gui.Chart; using NinjaTrader.Gui.SuperDom; using NinjaTrader.Gui.Tools; using NinjaTrader.Data; using NinjaTrader.NinjaScript; using NinjaTrader.Core.FloatingPoint; using NinjaTrader.NinjaScript.Indicators; using NinjaTrader.NinjaScript.DrawingTools; using NinjaTrader.NinjaScript.Indicators.Gemify; #endregion //This namespace holds Strategies in this folder and is required. Do not change it. namespace NinjaTrader.NinjaScript.Strategies { public class test : Strategy { private int Var; private NinjaTrader.NinjaScript.Indicators.Gemify.ICTFVG ICTFVG1; private ICTFVG fvgIndicator; protected override void OnStateChange() { if (State == State.SetDefaults) { Description = @"Enter the description for your new custom Strategy here."; Name = "test"; Calculate = Calculate.OnBarClose; EntriesPerDirection = 1; EntryHandling = EntryHandling.AllEntries; IsExitOnSessionCloseStrategy = true; ExitOnSessionCloseSeconds = 30; IsFillLimitOnTouch = true; MaximumBarsLookBack = MaximumBarsLookBack.TwoHundredFiftySix; OrderFillResolution = OrderFillResolution.Standard; Slippage = 0; StartBehavior = StartBehavior.WaitUntilFlat; TimeInForce = TimeInForce.Gtc; TraceOrders = false; RealtimeErrorHandling = RealtimeErrorHandling.StopCancelClose; StopTargetHandling = StopTargetHandling.PerEntryExecution; BarsRequiredToTrade = 40; // Disable this property for performance gains in Strategy Analyzer optimizations // See the Help Guide for additional information IsInstantiatedOnEachOptimizationIteration = true; Parameter = 1; Var = 1; } else if (State == State.Configure) { AddDataSeries("ES 09-23", Data.BarsPeriodType.Minute, 5, Data.MarketDataType.Last); } else if (State == State.DataLoaded) { ICTFVG1 = ICTFVG(Close, true, NinjaTrader.NinjaScript.Indicators.Gemify.FVGPeriodTypes.Minute, 5, 1000, true, 10, 1.1, 0.01, NinjaTrader.NinjaScript.Indicators.Gemify.FVGFillType.CLOSE_THROUGH, true, false, Brushes.Maroon, Brushes.Maroon, Brushes.DarkGreen, Brushes.DarkGreen, 13, 4, true, NinjaTrader.NinjaScript.DrawingTools.TextPosition.TopRight, new SimpleFont("Verdana", 12) {Bold = false, Italic = false}, Brushes.WhiteSmoke, Brushes.DimGray, Brushes.Blue, 50); fvgIndicator = ICTFVG(Close, true, NinjaTrader.NinjaScript.Indicators.Gemify.FVGPeriodTypes.Minute, 5, 1000, true, 10, 1.1, 0.01, NinjaTrader.NinjaScript.Indicators.Gemify.FVGFillType.CLOSE_THROUGH, true, false, Brushes.Maroon, Brushes.Maroon, Brushes.DarkGreen, Brushes.DarkGreen, 13, 4, true, NinjaTrader.NinjaScript.DrawingTools.TextPosition.TopRight, new SimpleFont("Verdana", 12) { Bold = false, Italic = false }, Brushes.WhiteSmoke, Brushes.DimGray, Brushes.Blue, 50); SetTrailStop(@"5", CalculationMode.Percent, 0, false); SetProfitTarget(@"20", CalculationMode.Ticks, 0); } } protected override void OnBarUpdate() { // Check for FVG conditions and implement your strategy logic here if (fvgIndicator != null && fvgIndicator.FVGList.Count > 0) { // Access FVG data and information using fvgIndicator.FVGList // Implement your trading logic based on the detected FVGs // For example, you can enter long or short positions when specific FVG conditions are met. } } #region Properties [NinjaScriptProperty] [Range(1, int.MaxValue)] [Display(Name="Parameter", Order=1, GroupName="Parameters")] public int Parameter { get; set; } #endregion } }
i am trying to access fvg variable from the indicator and i just cant
fvg.lowerPriceLast edited by tkaboris; 09-09-2023, 10:33 AM.
Comment
-
Hi, can anybody be so kind to help me out. I have to tell you I am having a ton of problems fixing all the errors I have in Ninja Editor, which I am not technical software person whatsoever.
I can not import the ICTFVG-v0.0.2.3 because of all the tons of errors. There are just too many errors and I am getting head ache fooling around with the Ninja Editor. I would really love to get this indicator into my NinjaTrader, it seems to be such a great tool! Would somebody be so kind, who knows a way I can import the ICTFVG-v0.0.2.3 files without go through the normal way of Importing files. If you know how, would you please send me exact details instructions how to do so! You will be so greatly appreciated!! Sincerely yours always, Andrewsforex.
Comment
-
Hi tkaboris, like I was mentioning earlier, there are a TON of errors and it took me a good while to SnagIt the Errors. So I am not sure how the Capture will look here, but
here it is anyway. Hope you can help! Appreciate it! Andrewsforex programming errors in NinjaScript - NinjaEditor.pdf
Comment
-
I don't know if you got the copies of the files Tkaboris, but here I try again.
Comment
-
-
Yes, that would be ideal!Originally posted by JasonX View PostThank you for the ingenious indicator.
I would like to be able to choose the thickness of the line of the rectangle.
Thank you very much!
I found one more thing there - the Filed Area color does not correspond to the selected settings.
I took a screenshot of this error. And also presented what this indicator would look like with the correct color and thin and transparent Borders. In the main settings, I made the Area less transparent for clarity.
And the indicator is great! You can use it to create your own trading strategy! Thanks to the author!
Last edited by Nikolaibalt; 11-05-2023, 03:47 AM.
Comment
-
Hello. gemify Thank You for this indicator it is amazing. One question.... Is there anyway to have it Flag the Order Block candle before the FVG when they print on the very next candle? That would change the game. There is a trading view indicator that does this and I would LOVE if we could edit yours in this manner. Please and Thank You.
- Likes 1
Comment
Latest Posts
Collapse
| Topics | Statistics | Last Post | ||
|---|---|---|---|---|
|
Started by Geovanny Suaza, 02-11-2026, 06:32 PM
|
0 responses
599 views
0 likes
|
Last Post
|
||
|
Started by Geovanny Suaza, 02-11-2026, 05:51 PM
|
0 responses
344 views
1 like
|
Last Post
|
||
|
Started by Mindset, 02-09-2026, 11:44 AM
|
0 responses
103 views
0 likes
|
Last Post
by Mindset
02-09-2026, 11:44 AM
|
||
|
Started by Geovanny Suaza, 02-02-2026, 12:30 PM
|
0 responses
558 views
1 like
|
Last Post
|
||
|
Started by RFrosty, 01-28-2026, 06:49 PM
|
0 responses
557 views
1 like
|
Last Post
by RFrosty
01-28-2026, 06:49 PM
|

Comment