Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Multi Time Frame Draw Object

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

    Multi Time Frame Draw Object

    So the indicator is supposed to show buy and sell signals from the 60M chart on any time frame in the form of a bar background in green or red.

    The problem is that I am only seeing the actual bar background marker on the 60M chart:


    Initialize code:
    protected override void Initialize()
    {

    Overlay = true;
    DrawOnPricePanel = true;
    CalculateOnBarClose = false;
    Add(PeriodType.Minute, 60);

    }



    Draw code:
    {
    BackColorAllSeries[0] = Color.Lime;
    DrawText("BUY" + CurrentBar, false, "BUY HFT16", 0, Low[0], -60, Color.Black, textFont, StringAlignment.Center, Color.Transparent, Color.Transparent, 0);
    }

    #2
    Hello brucelevy,

    Thank you for writing in. Because you are using a multi time frame script, could you please let me know which data series you are setting the bar color on?
    For Example: BarsInProgress == 1 etc.

    You need to make sure the primary data series is calling OnBarUpdate, when you set the BackColorAllSeries variable.

    Thank you in advance.
    Michael M.NinjaTrader Quality Assurance

    Comment


      #3
      I don't have it set to anything, I would like it to show on every dataseries

      Comment


        #4
        Hello brucelevy,

        Here is an example:
        Code:
        protected override void Initialize()
        {
          Overlay = true;
          DrawOnPricePanel = true;
          CalculateOnBarClose = false;
          Add(PeriodType.Minute, 60);
        }
        protected override void OnBarUpdate()
        {
        if(BarsInProgress == 0)
          {
            if(CurrentBars[1] % 10 == 0) //Replace this with your condition. Make sure you are checking the values in the 60 minute data series
            {
              BackColorAllSeries[0] = Color.Lime; 
            }
          }
        }
        Please let me know if you require further clarification.
        Michael M.NinjaTrader Quality Assurance

        Comment


          #5
          60 and a 30m chart side by side: https://gyazo.com/ca70426662588beedbd17dd78d5af400

          protected override void Initialize()
          {


          Overlay = true;
          DrawOnPricePanel = true;
          CalculateOnBarClose = false;
          Add(PeriodType.Minute, 60);

          }

          protected override void OnBarUpdate()
          {

          if(BarsInProgress == 0)

          //BUY SELL SIGNALS FROM HFT16 60M
          // Condition set 1 Long 1
          if (FisherTransform(BarsArray[1], 10)[0] > 0))

          {
          BackColorAllSeries[0] = Color.Lime;
          DrawText("BUY" + CurrentBar, false, "BUY HFT16", 0, Low[0], -60, Color.Black, textFont, StringAlignment.Center, Color.Transparent, Color.Transparent, 0);

          }
          }
          Last edited by brucelevy; 10-25-2015, 03:53 PM.

          Comment


            #6
            Hello brucelevy,

            Do you have your indicator applied to both charts? You will have to have your indicator applied to both charts for it to be able to change the bar background on each chart. You cannot affect the colors on another chart using BackColorAllSeries (or any method in NinjaScript).

            Also I have made some slight adjustments to the code you provided:
            Code:
            protected override void OnBarUpdate()
            {
            //BUY SELL SIGNALS FROM HFT16 60M
            // Condition set 1 Long 1
            if (BarsInProgress == 0 && FisherTransform(BarsArray[1], 10)[0] > 0))
            {
            BackColorAllSeries[0] = Color.Lime; 
            DrawText("BUY" + CurrentBar, false, "BUY HFT16", 0, Low[0], -60, Color.Black, textFont, StringAlignment.Center, Color.Transparent, Color.Transparent, 0);
            }
            }
            Please let me know if I may be of further assistance.
            Michael M.NinjaTrader Quality Assurance

            Comment

            Latest Posts

            Collapse

            Topics Statistics Last Post
            Started by Geovanny Suaza, 02-11-2026, 06:32 PM
            0 responses
            633 views
            0 likes
            Last Post Geovanny Suaza  
            Started by Geovanny Suaza, 02-11-2026, 05:51 PM
            0 responses
            364 views
            1 like
            Last Post Geovanny Suaza  
            Started by Mindset, 02-09-2026, 11:44 AM
            0 responses
            105 views
            0 likes
            Last Post Mindset
            by Mindset
             
            Started by Geovanny Suaza, 02-02-2026, 12:30 PM
            0 responses
            567 views
            1 like
            Last Post Geovanny Suaza  
            Started by RFrosty, 01-28-2026, 06:49 PM
            0 responses
            568 views
            1 like
            Last Post RFrosty
            by RFrosty
             
            Working...
            X