Announcement

Collapse

Looking for a User App or Add-On built by the NinjaTrader community?

Visit NinjaTrader EcoSystem and our free User App Share!

Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
See more
See less

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 Rapine Heihei, 04-23-2024, 07:51 PM
            2 responses
            30 views
            0 likes
            Last Post Max238
            by Max238
             
            Started by Shansen, 08-30-2019, 10:18 PM
            24 responses
            943 views
            0 likes
            Last Post spwizard  
            Started by Max238, Today, 01:28 AM
            0 responses
            9 views
            0 likes
            Last Post Max238
            by Max238
             
            Started by rocketman7, Today, 01:00 AM
            0 responses
            7 views
            0 likes
            Last Post rocketman7  
            Started by wzgy0920, 04-20-2024, 06:09 PM
            2 responses
            28 views
            0 likes
            Last Post wzgy0920  
            Working...
            X