Time frame label

greetings friends,

I am trying to plot the time frame labels
e.g. in daily timeframe, I have plot trend line at that time at begining or end of that trend line should text as Daily Timeframe , so when I switch to other timeframe say weekly, Trend line should show text say daily time frame trend line. Please help me with this code

Hii guys no response for my query, I just rephrase the query,
How to plot layer name on chert ? , Please reply guys.

@sandeep,

Would putting it in the Title work?

Title = EncodeColor(colorwhite) + StrToUpper(Interval(2)) ;

@sandeep - one of the default charts available after installing AB, called "Price", in a folder called "Basic Charts" has the following code:

SetChartOptions(0,chartShowArrows|chartShowDates);
_N(Title = StrFormat("{{NAME}} - {{INTERVAL}} {{DATE}} Open %g, Hi %g, Lo %g, Close %g (%.1f%%) {{VALUES}}", O, H, L, C, SelectedValue( ROC( C, 1 ) ) ));
Plot( C, "Close", ParamColor("Color", colorDefault ), styleNoTitle | ParamStyle("Style") | GetPriceStyle() ); 

It includes the interval.

If you're wanting something more sophisticated than that, pls specify more clearly what you want, particularly with an illustration/ example.

com-video-to-gif

This is marked on 125 min chart , I want label on marked zone
which should be same in all time frame

Hi @sandeep, thanks for the animated illustration, that give us more info on what you want.

The toolbar (at the top) already has the timeframe in it, as do the "Title" just below the toolbar, and the (pale) text in the background "125-min", so I don't understand what it is that you want (let alone why it's necessary to do it again), when all the information you need/ have requested, is already available/ on-chart.

Is there only one timeframe to be plotted in the chart, or many different ones?

What is the condition that triggers the info to be plotted, and where on the chart?

What does this mean? Please be more specific:

There's an awful lot going-on in the video - can you pls provide a description of what you want to achieve - do you want to automagically put some "studies" on the chart, or, use lines and text to achieve the same thing (all of which relates to specific price levels and the timeframe).

We can then use the description in relation to the video, to provide further advice.

@sandeep - as @phase21 wrote, the information about current chart's interval is already repeated three times on your chart. Isn't that enough? If for some reason you want to additionally display it somewhere else, why don't you simply use Interval() and PlotText() or GfxTextOut()? Your AFL (which you didn't show us) is already displaying Entry, Risk and Stop levels, so adding another information should be very simple.

By the way, your first post in this thread is 8 months old. Have you done anything since then to find a solution on your own?

1 Like

I have assigned interval() to variable,
Markedzone=interval() and , when interval changes the displayed text also changed, I am trying to display only interval in which i have marked the zone.

In my video example i have marked zone on 125 min. I want to display the interval label (125-min) in the zone automatically ,but when i assign interval() to the variable , and change the time frame say to daily the displayed text also changed from 125 min to daily. I hope it clarify.

@Milosz I was held up with something else. Thanx for replying my queries

@sandeep I'm afraid I still don't understand your goal, but maybe instead of coding, simply try using drawing tools and first draw some objects (rectangles, zones, studies etc. accompanied by a text), assign them a proper layer and then you could either switch between different layers manually or such objects with descriptions would be shown or hidden automatically when switching timeframes manually. See the animated gif:

https://www.amibroker.com/guide/drawtools.html
https://www.amibroker.com/guide/h_layers.html
https://www.amibroker.com/video/layers.html

Hello @sandeep - I'm sorry, but it's still not clear to me what you want to achieve.

The code fragment and new video add more details, but the other code that surrounds and "drives" it would be more helpful.

Are you programming a "study", because the one you use in the video doesn't seem to be a part of AmiBroker. Do you want to enhance a study from a third-party supplier?

With most IT-related things, clearly defining what you want is the hardest part, so could you pls provide a description of what the objective is, and the steps required to make it happen. No more videos.

Here're some suggestions on how to structure your question, so that people are more likely to want to help you:

Writing the perfect question
How To Ask Questions The Smart Way

I believe I understand what he’s looking for. No idea how to help him myself.

For instance if he draws a trend line on a daily timeframe, he wants it labelled “daily” so if he changes timeframes, that study is labelled the timeframe it was drawn on. On a weekly chart, that trend line/zone or whatever study he has in the video, would be labelled “daily” as that’s the timeframe it was drawn on.

Sounds complex, not sure where you could start to have it automatic. You’d have to flag the timeframe of when the study was drawn.

1 Like

@phase21
It's amibroker only , it's Fibonacci tool set to 0 and 100 all other checkbox unchecked, it's simple plot text by using study, My programming skills are very poor, I have solved most of the problems by very helpful forum members, So I thought no use of posting 500 lines of unnecessary code, I posted only related code

And that is exactly what I suggested in my post above. No coding required at all.

@sandeep just draw an object (a trendline, rectangle etc.) and then use Text tool to label it. This is vey basic stuff - I really don't understand what's the problem? Whether these studies with labels (or other annotations) are visible in all timeframes or only selected, depends on the layer selected in object's properties (daily, weekly, Intraday, custom etc.) All it takes is learning how to use drawing tools (also text tool) and layers. Links and examples are provided above.

1