Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Price line colors in accordance to time frame

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

    Price line colors in accordance to time frame

    Is there a way to predefine color settings of price lines based on the time frame of the chart you currently are drawing on? I would like my price lines to show up different shades of Blue based on the time frame and I dont want to have to change each line as I draw it. For instance, if i am on weekly i want it to draw dark blue and if i am on 1 minute chart i want it to draw light sky blue instead of default..

    #2
    Hello sashol3,

    If you are referring to the price line indicator you would have to save different chart templates with the timeframe name in it to be able to do that using the UI. The alternative is to open the indicator in the editor and Right click -> Save as to create a copy. You can then use the bars type information to set plot colors. Heres an example of how to do that:

    Code:
    else if (State == State.DataLoaded)
    {
        if(Bars.BarsType.BarsPeriod.BarsPeriodType == BarsPeriodType.Day)
       {
          AskStroke = new Stroke(Brushes.Red, DashStyleHelper.Dash, 1);
          BidStroke = new Stroke(Brushes.Red, DashStyleHelper.Dash, 1);
          LastStroke = new Stroke(Brushes.Red, DashStyleHelper.Dash, 1);
       }
       if(Bars.BarsType.BarsPeriod.BarsPeriodType == BarsPeriodType.Minute && Bars.BarsType.BarsPeriod.Value == 1)
       {
          AskStroke = new Stroke(Brushes.Green, DashStyleHelper.Dash, 1);
          BidStroke = new Stroke(Brushes.Green, DashStyleHelper.Dash, 1);
          LastStroke = new Stroke(Brushes.Green, DashStyleHelper.Dash, 1);
       }
    }​

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by CaptainJack, 05-29-2026, 05:09 AM
    0 responses
    386 views
    0 likes
    Last Post CaptainJack  
    Started by CaptainJack, 05-29-2026, 12:02 AM
    0 responses
    252 views
    0 likes
    Last Post CaptainJack  
    Started by charlesugo_1, 05-26-2026, 05:03 PM
    0 responses
    211 views
    1 like
    Last Post charlesugo_1  
    Started by DannyP96, 05-18-2026, 02:38 PM
    1 response
    298 views
    0 likes
    Last Post NinjaTrader_ChelseaB  
    Started by CarlTrading, 05-11-2026, 05:56 AM
    0 responses
    263 views
    0 likes
    Last Post CarlTrading  
    Working...
    X