plotText?

Posted By: WaltT

plotText? - 08/21/22 21:59

I want to put some text at the top of every candle on the chart, so I can plot some visual values along with the graphic plot lines.

Toward this end, I tried:

plotText("Message",wdateBar(0),priceH(0)+.01,"Text Goes Here!",0+64+128,BLACK);

but that doesn't seem to work. Suggestions?
Posted By: anissyo

Re: plotText? - 08/23/22 13:29

I can suggest printing to the log file instead :

you need to add set(LOGFILE); inside the run() function

then just print stuff that you want using :

print (TO_LOG," stuff that you want to print");

But keep in mind that you will need to convert float or int to strings, just ask me to show you how to convert them to strings if it's what you need.

the output of the print() statement is visible in the log file that will appear in notepad ++ once you click test
Posted By: WaltT

Re: plotText? - 08/23/22 16:31

Thanks for the suggestion. I already do that. The reason I wanted the text on the chart is that I wanted a quick way to visualize some test results against the chart itself, like noticing at a glance whether a buy or a sell was made at a relative peak or valley, or whether they occurred after certain visual chart patterns.

I've sent an email to Zorro support because I tried the example command they supplied in the manual for plotText, and even their example code doesn't work! I suspect there's a bug somewhere.
Posted By: anissyo

Re: plotText? - 08/24/22 12:15

AH ok ok, nice nice. I hope that you will get that to work I tried to use it too in the past but I ended up just using print() instead, good luck =)
Posted By: WaltT

Re: plotText? - 08/24/22 19:11

Interesting thing ... I just found that the function does seem to work ... sort of.

However, it doesn't quite behave as I expected. The code I listed above results in a single message appearing in one place only on the graph in very small type. I thought it would appear with every bar, but it doesn't. It just appears once on the graph.

I haven't figured out how it interprets the X, Y values. If you don't zoom on the "correct" section of the graph, you won't see it at all. The X,Y values don't seem to correlate with the date or price level at all. To see it, you have to zoom in at least one level deep on the correct portion of the chart, and you can't see it at all in the original, normal, full-out view at all.

I'm experimenting to see if I can figure out more about how this function works. I'll try looping through all of the bars to see if that works.

When I printf the value of wdate(n) to a float format, I get a result like this one: 38328.125000. The first 5 digits seem to represent one single day, so I'm guessing that the six digits after the decimal refer to a decimalized breakdown of the time in a day to roughly tenths of a second (or slightly greater). I've never seen this particular timestamp before. Have you? I suspect I'll need to convert this to a more conventional timestamp in order to get the x-axis to plot where I want it to plot.
Posted By: anissyo

Re: plotText? - 08/25/22 10:33

This format? no, I have not seen this format for timestamps before, all of this need a lot of attention to understand and I really can't right now, I need to work on some code, but I hope that you manage to sort things out bro
Posted By: Spirit

Re: plotText? - 08/27/22 01:22

You can plot text on relative or absolute xy position, absolute x is pixels and relative x is bar offset. You see text only when you zoom in.

The format is the usual windows date/time format, simply number of days since 1900.

© 2024 lite-C Forums