AmiBroker formula Language

Hello karthikmrar sir,
I want to find highest high and lowest low values of previous 20 days.for this i had written hhv function.But is showing all values from current date.But i want only highest high and lowestlow from past 20days.Can you help regarding this.
 
hello,

The beta version of Amibroker (5.02.2) can be find the solution, to set the candle color independently,but still it heavy for me in this manner yet unfortunately to write the correct formula . More hours I spent an attempt but I could not write the right formula.
Only a step separates already from the solution.
I have to modify only one value simply that: IIf( (C > O)AND (C < Ref( C, -1)) colorwhite( show candle with red outline but white inside)

_SECTION_BEGIN("Price");
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 ) ) ));
if (SetBarFillColor( IIf( (C < O) AND (C < Ref( C, -1)), colorRed, colorGreen ) ) );
else
(SetBarFillColor( IIf( (C > O)AND (C < Ref( C, -1)), colorWhite,colorWhite)));
Plot( C, "Close",IIf( Close < Ref( Close, -1), colorRed, colorGreen ), styleCandle );
_SECTION_END();
Do you know what is wrong in my afl coding?
Thank you your help
 
unfortunately no position can be fixed without referring an array!

But we can try with barcount to locate the position you need to get!

And after getting that initial position using barcount, we can feed data to the new PlotOHLC array for the particular point! all others point till barcount can be set null!

I am not that that familiar with Ami, but will try my best for a solution!

I am trying to plot H20 if H-L>5.

I will post it here if i win.. else you can assume!!!:D

Was that "Sir" a sarcastic one!

Dont embrace me BAV...I am younger and much inexperienced than you...
Please call me kuriako :)
 
Last edited:
Here it goes BAV!:)
Hello Kuri

Right click on the chart you get parameters, in the parameter window u get Axis and Grid tab, in that you have a choice to select Upper/Lower Limit - Yes/No

If you can get these values in your program, you should be able draw your vertical line, similar to the H2O lines.

Thanks
nb
___________________________________
TRADE WHAT YOU SEE, NOT WHAT YOU THINK
 
Hello Kuri
...............
If you can get these values in your program, you should be able draw your vertical line, similar to the H2O lines.

Thanks
nb
But that are just MAX and MIN value of the current visible part of chart(inside window)!

We need to fix position of the bar where vertical line need to be drawn!

I didnt understand your point clearly!Sorry!:)
 
But that are just MAX and MIN value of the current visible part of chart(inside window)!

I didnt understand your point clearly!Sorry!:)
Its not your fault, its me. ;)

Maybe I am giving you a route to hydrabad, when you need hydrabadi biryani !

I meant you should use the Max Min values of current visible part of the chart as high low of the bar, something similar to the H2O lines you have already drawn !!

To draw a line you need, 2 points and vertical line can be drawn as a single bar, instead of multiple ones you did with the above example.

We need to fix position of the bar where vertical line need to be drawn!
Now thats the best one, you should be knowing which bar you want to draw a line for, right ! am sure you don't plan to draw random vertical lines

You would have some reasons to choose the bar, same reasons / logic should be used to place the line.

Maybe its still not clears, remember its me, not you who is :confused:.

Thanks
nb
___________________________________
TRADE WHAT YOU SEE, NOT WHAT YOU THINK
 
Scenario!

Naughty BAV (hope he is not reading this:)) want to draw a vertical line of "certain dimension" above a particular bar!

So for selecting a particular bar i used a mock condition (H-L>5)

For plotting a vertical bar we need two points!

Say (x,y1) and (x.y2)

X is time...

y1 for the scenario is taken as H and
y2 as H+20

As we both are newbies, we can chit chat more like this! ;)
 

Similar threads