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 SalmaTrader, 07-07-2026, 10:26 PM
    0 responses
    54 views
    0 likes
    Last Post SalmaTrader  
    Started by CarlTrading, 07-05-2026, 01:16 PM
    0 responses
    25 views
    0 likes
    Last Post CarlTrading  
    Started by CaptainJack, 06-17-2026, 10:32 AM
    0 responses
    17 views
    0 likes
    Last Post CaptainJack  
    Started by kinfxhk, 06-17-2026, 04:15 AM
    0 responses
    23 views
    0 likes
    Last Post kinfxhk
    by kinfxhk
     
    Started by kinfxhk, 06-17-2026, 04:06 AM
    0 responses
    24 views
    0 likes
    Last Post kinfxhk
    by kinfxhk
     
    Working...
    X