Hello,
Is there any indicator available in Multicharts that display the current price, in big letters and in bold, on the right of the current candle, and that makes the text green when there is an uptick and red when there is a downtick?
Many thanks,
Displaying the current price above the current candle
- arnie
- Posts: 1594
- Joined: 11 Feb 2009
- Location: Portugal
- Has thanked: 481 times
- Been thanked: 514 times
Re: Displaying the current price above the current candle
Hi duration.
I decided to give it a try on your request
It's a way for me to train my lack of programmer skills
There are a couple of issues with the code.
First I couldn't make it turn green or red on each respective received tick. I tried to change colours when upticks were higher or lower than the downticks, but even here I had problems with it.
Let's hope one of the experts can shine some light on it.
Regards,
Fernando
I decided to give it a try on your request
It's a way for me to train my lack of programmer skills
Code: Select all
if currentbar = 1 then begin
value1 = text_new(date, time, 0, "");
text_setstyle(value1, 0, 2);
Text_SetSize(value1, 24);
end;
if LastBarOnChart then begin
value2 = close;
Text_SetString(value1, " " + NumToStr(value2, 2));
end;
Text_SetLocation(value1, Date, Time, value2);
if upticks > downticks then
Text_SetColor(value1, green)
else
if downticks < upticks then
Text_SetColor(value1, red)
else
if upticks = downticks then
Text_SetColor(value1, white);
First I couldn't make it turn green or red on each respective received tick. I tried to change colours when upticks were higher or lower than the downticks, but even here I had problems with it.
Let's hope one of the experts can shine some light on it.
Regards,
Fernando
Re: Displaying the current price above the current candle
Hello Arnie,
Thank you for your reply.
Here is what I wrote:
I agree it is difficut to make the price green for an uptick and red for a downtick..
In addition, I cannot find a way for the displayed price to stay right of the candle, it gradually moves left as time elapses...
Thank you for your reply.
Here is what I wrote:
Code: Select all
variables: lastprice(0);
if barstatus = 1 then begin
lastprice = text_new(date,time+1,close,text(close:0:4));
text_setattribute(lastprice,1,true);
text_setfontname(lastprice,"Calibri");
text_setsize(lastprice,12);
text_setstyle(lastprice,2,2);
text_setcolor(lastprice,white);
end;
In addition, I cannot find a way for the displayed price to stay right of the candle, it gradually moves left as time elapses...
- TJ
- Posts: 7743
- Joined: 29 Aug 2006
- Location: Global Citizen
- Has thanked: 1033 times
- Been thanked: 2222 times
Re: Displaying the current price above the current candle
the trick is to use text_setlocation to re-position the text to the last bar (ie. current bar).
see attached sample code.
see attached sample code.
- Attachments
-
- Last Price.txt
- (544 Bytes) Downloaded 458 times
Re: Displaying the current price above the current candle
Hi TJ,
Thank you for your code.
However the price still displays on the far right, and gradually comes back as time elapses... is there no way of having a "stable" location with Powerlanguage?
Many thanks,
Thank you for your code.
However the price still displays on the far right, and gradually comes back as time elapses... is there no way of having a "stable" location with Powerlanguage?
Many thanks,
- TJ
- Posts: 7743
- Joined: 29 Aug 2006
- Location: Global Citizen
- Has thanked: 1033 times
- Been thanked: 2222 times
Re: Displaying the current price above the current candle
are you sure you are using my code?Hi TJ,
Thank you for your code.
However the price still displays on the far right, and gradually comes back as time elapses... is there no way of having a "stable" location with Powerlanguage?
Many thanks,
or maybe you are using the code in a sub-minute chart?
Re: Displaying the current price above the current candle
Hi TJ,
Well spotted, I am using the code with a 4 point chart.
Is this a problem?
Many thanks,
Well spotted, I am using the code with a 4 point chart.
Is this a problem?
Many thanks,
- TJ
- Posts: 7743
- Joined: 29 Aug 2006
- Location: Global Citizen
- Has thanked: 1033 times
- Been thanked: 2222 times
Re: Displaying the current price above the current candle
you have to change the following keywords:Hi TJ,
Well spotted, I am using the code with a 4 point chart.
Is this a problem?
Many thanks,
text_new
text_setlocation
time
to
text_new_s
text_setlocation_s
time_s
Re: Displaying the current price above the current candle
Hi TJ,
Thank you! This does it.
No idea on how to make the price colour change to green or red when there is an uptick or downtick?
Many thanks,
Thank you! This does it.
No idea on how to make the price colour change to green or red when there is an uptick or downtick?
Many thanks,
- TJ
- Posts: 7743
- Joined: 29 Aug 2006
- Location: Global Citizen
- Has thanked: 1033 times
- Been thanked: 2222 times
Re: Displaying the current price above the current candle
Where There is a Will, There is a Way...Hi TJ,
Thank you! This does it.
No idea on how to make the price colour change to green or red when there is an uptick or downtick?
Many thanks,
- Attachments
-
- Last Price b03.txt
- (941 Bytes) Downloaded 499 times
Re: Displaying the current price above the current candle
Hi TJ,
Thanks a lot!
close < or > lastprice is very smart, I was stuck with up & down ticks.
It works perfectly now.
Thanks again and take care,
Thanks a lot!
close < or > lastprice is very smart, I was stuck with up & down ticks.
It works perfectly now.
Thanks again and take care,
- TJ
- Posts: 7743
- Joined: 29 Aug 2006
- Location: Global Citizen
- Has thanked: 1033 times
- Been thanked: 2222 times
Re: Displaying the current price above the current candle
ywHi TJ,
Thanks a lot!
close < or > lastprice is very smart, I was stuck with up & down ticks.
It works perfectly now.
Thanks again and take care,
- TJ
- Posts: 7743
- Joined: 29 Aug 2006
- Location: Global Citizen
- Has thanked: 1033 times
- Been thanked: 2222 times
Re: Displaying the current price above the current candle
What you required is the uptick/downtick compared to the previous tick.Hi TJ,
Thanks a lot!
close < or > lastprice is very smart, I was stuck with up & down ticks.
It works perfectly now.
Thanks again and take care,
but the keywords (note the "s")
UpTicks refers to the total number of Up ticks for the current bar.
DownTicks refers to the total number of Down ticks for the current bar.