Simple Coding Help - No Promise.

Is it possible to display first candle open, high, low, close price in a place like using GfxTextOut respective of time frame. I tried with C[0] but didn't get it.

thanks
for first candle use code

Code:
ND = Day()!=Ref(Day(),-1);
O1 = ValueWhen(ND,Open);

Happy :)
 
But how to use this value to display in box. I use below code and it is giving error.

Code:
ND = Day()!=Ref(Day(),-1);
O1 = ValueWhen(ND,Open);

GfxSelectFont("Arial", 20);
GfxTextOut(O1, 20, 50);
Hello Ankur

Did you read help on GfxTextOut

does it accept a numerical variable or needs a string for out put

how do you convert a number to string in amibroker

what does the amibroker help say about it.

Cheers :thumb:

Happy :)
 
Hello Ankur

Did you read help on GfxTextOut

does it accept a numerical variable or needs a string for out put

how do you convert a number to string in amibroker

what does the amibroker help say about it.

Cheers :thumb:

Happy :)
Thanks for pointing out error...:eek:
Now it's working.
Code:
ND = Day()!=Ref(Day(),-1);
O1 = ValueWhen(ND,High);
GfxSelectFont("Arial", 20);
GfxTextOut(NumToStr(O1), 20, 50);
 
Ok,

The code posted by me draws one horizontal line across the chart for last bull candle and nothing if its a bear or doji

But now not sure what exactly is your requirement, anyway will give it one more try

Code:
Plot(IIf(C > O, C, Null),"Price2", colorLightGrey,styleNoLabel|styleThick|styleStaircase,0,0,1);

Code:
HourO = TimeFrameGetPrice("O", inHourly, -1);  
HourC = TimeFrameGetPrice("C", inHourly, -1);  
Plot(IIf(HourC>HourO,HourC,Null),"",colorAqua,styleDots|styleNoLine|styleNoRescale|styleNoTitle);  
Plot(IIf(HourC<HourO,HourC,Null),"",colorRed,styleDots|styleNoLine|styleNoRescale|styleNoTitle);


one more version

Code:
/*
HourO = TimeFrameGetPrice("O", inHourly,0,expandFirst);
HourC = TimeFrameGetPrice("C", inHourly,0,expandFirst);
Plot(IIf(HourC>HourO,HourC,Null),"",colorAqua,styleDots|styleNoLine|styleNoRescale|styleNoTitle);  
Plot(IIf(HourC<HourO,HourC,Null),"",colorRed,styleDots|styleNoLine|styleNoRescale|styleNoTitle);
*/
HourO = TimeFrameGetPrice("O", inHourly,0,expandLast);
HourC = TimeFrameGetPrice("C", inHourly,0,expandLast);
Plot(IIf(HourC>HourO,HourC,Null),"",colorAqua,styleDots|styleNoLine|styleNoRescale|styleNoTitle);  
Plot(IIf(HourC<HourO,HourC,Null),"",colorRed,styleDots|styleNoLine|styleNoRescale|styleNoTitle);
Happy :)
thanks
when we use styleStaircase , it shows as per below


When we use styleDots , it shows as per \


In Dots, it works good when we go to 5 min .or small timeframes . I've used HourC/o ..as we need lines that do not change.
But in Dots,
if you see 55 minute such timeframes , it has very less or just one dot..

as styleDots, is there any way we can make thick small horizontal line..not styleStaircase .. I'm searching for it,let's see if there is

Let me check it in market replay, if it moves like before, i will use -1..
 
thanks
when we use styleStaircase , it shows as per below



In Dots, it works good when we go to 5 min .or small timeframes . I've used HourC/o ..as we need lines that do not change.
But in Dots,
if you see 55 minute such timeframes , it has very less or just one dot..

as styleDots, is there any way we can make thick small horizontal line..not styleStaircase .. I'm searching for it,let's see if there is

Let me check it in market replay, if it moves like before, i will use -1..
Code:
HourO = TimeFrameGetPrice("O", inHourly,0,expandLast);
HourC = TimeFrameGetPrice("C", inHourly,0,expandLast);
Hi = IIf(HourC>HourO,HourC,Null);
Lo = IIf(HourC<HourO,HourC,Null);
Plot(IIf(Hi==Ref(Hi,-1),Hi,Null),"",colorAqua,styleThick|styleStaircase|styleNoRescale|styleNoLabel);  
Plot(IIf(Lo==Ref(Lo,-1),Lo,Null),"",colorRed,styleThick|styleStaircase|styleNoRescale|styleNoLabel);
Plot(Hi,"",colorAqua,styleDots|styleNoLine|styleNoRescale);  
Plot(Lo,"",colorRed,styleDots|styleNoLine|styleNoRescale);


Happy :)
 
Last edited:
hi,

please helpe me with afl for following conditions. i want sell arrow above the candle fulfilling the conditions.
a) today C<O
b) yday C>O
c) yday bar/candle range must be minimum 2 time average range of last 50 bars.
d) yday C-O i.e body must be .50-.75 times to yday range (H-L).

kindly help.

regds,s
 

Similar threads