Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

referencing multi time indicator in barsinprogress 2

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

    referencing multi time indicator in barsinprogress 2

    HI i have an indicator that uses multitime frame plotting.
    In my data loaded i have this where i load indicator and it works fine

    fvgIndicator = FVGICT(Close, false, FVGPeriodTypes.Minute, 2, 50, true, 1.1, 10, 2, true,
    FVGFillType.CLOSE_THROUGH, false, false,
    false,new TimeSpan(2, 14, 18),60,
    false,new TimeSpan(2, 14, 18),60,
    false,new TimeSpan(2, 14, 18),60,
    Brushes.LimeGreen, Brushes.LimeGreen, Brushes.Green, Brushes.Crimson, Brushes.Crimson, Brushes.DarkRed, 13, 20, true,
    NinjaTrader.NinjaScript.DrawingTools.TextPosition. TopRight, new SimpleFont("Verdana", 12) { Bold = false, Italic = false },
    Brushes.WhiteSmoke, Brushes.DimGray, Brushes.Blue, 50);

    However when i switch to true to use multi timeframe for Minute 5 - fvgIndicator = FVGICT(Close, true, FVGPeriodTypes.Minute, 5, 50, true, 1.1, 10, 2, true,...
    i get error
    tried to load additional data. All data must first be loaded by the hosting NinjaScript in its configure state. Attempted to load NQ 12-23 Globex: 5 Minute

    my question is how do I load indicator on barsinprogress 2? Whatever i did below is not working


    else if (BarsInProgress == 2 )
    if (CurrentBars[0] < 20 || CurrentBars[2] < 6 )
    return;

    fvgIndicator = FVGICT(Close, true, FVGPeriodTypes.Minute, 5, 50, true, 1.1, 10, 2, true,
    FVGFillType.CLOSE_THROUGH, false, false,
    false,new TimeSpan(2, 14, 18),60,
    false,new TimeSpan(2, 14, 18),60,
    false,new TimeSpan(2, 14, 18),60,
    Brushes.LimeGreen, Brushes.LimeGreen, Brushes.Green, Brushes.Crimson, Brushes.Crimson, Brushes.DarkRed, 13, 20, true,
    NinjaTrader.NinjaScript.DrawingTools.TextPosition. TopRight, new SimpleFont("Verdana", 12) { Bold = false, Italic = false },
    Brushes.WhiteSmoke, Brushes.DimGray, Brushes.Blue, 50);​

    Thank you​
    Last edited by tkaboris; 09-21-2023, 05:05 PM.

    #2
    Sorry my mistake forgot to add data series. All working

    However i want to change indicators true/false value from the strategy.
    I am not sure if i amdoing it the best way, but its compaining that cant convert bool to int

    fvgIndicator = FVGICT(Close, true, FVGPeriodTypes.Minute, 5, 50, true, 1.1, 10, 2, true,
    FVGFillType.CLOSE_THROUGH, false, false,
    false,new TimeSpan(2, 14, 18),60,
    false,new TimeSpan(2, 14, 18),60,
    false,new TimeSpan(2, 14, 18),60,
    Brushes.LimeGreen, Brushes.LimeGreen, Brushes.Green, Brushes.Crimson, Brushes.Crimson, Brushes.DarkRed, 13, 20, true,
    NinjaTrader.NinjaScript.DrawingTools.TextPosition. TopRight, new SimpleFont("Verdana", 12) { Bold = false, Italic = false },
    Brushes.WhiteSmoke, Brushes.DimGray, Brushes.Blue, 50);​
    ​​


    public enum TrueFalseEnum
    {
    True = true,
    False = false
    }​

    TrueFalseEnum = TrueFalseEnums.False;

    [NinjaScriptProperty]
    [Display(Name = "Use MTF Indicator", Order = 100, GroupName = "01. FVGTrade")]
    public TrueFalseEnum TrueFalseEnums
    { get; set; }​

    Click image for larger version

Name:	image.png
Views:	176
Size:	680.1 KB
ID:	1269919

    Comment


      #3
      Hello tkaboris,

      To pass a value to the indicator you need to set that when you create the indicator in State.DataLoaded. You would use the input your indicator has for the property and set it to true or false. If you want to make that a user input you need to use a bool property.

      Comment


        #4
        Hi i think thats what i did setting enum to bool

        Comment


          #5
          Hello tkaboris

          An enum is not a bool, you need to make a bool property. If you are unsure what that looks like I would suggest using the strategy builder to create a bool user input and then view the code.

          Comment

          Latest Posts

          Collapse

          Topics Statistics Last Post
          Started by NullPointStrategies, Today, 05:17 AM
          0 responses
          50 views
          0 likes
          Last Post NullPointStrategies  
          Started by argusthome, 03-08-2026, 10:06 AM
          0 responses
          126 views
          0 likes
          Last Post argusthome  
          Started by NabilKhattabi, 03-06-2026, 11:18 AM
          0 responses
          69 views
          0 likes
          Last Post NabilKhattabi  
          Started by Deep42, 03-06-2026, 12:28 AM
          0 responses
          42 views
          0 likes
          Last Post Deep42
          by Deep42
           
          Started by TheRealMorford, 03-05-2026, 06:15 PM
          0 responses
          46 views
          0 likes
          Last Post TheRealMorford  
          Working...
          X