Welcome to NexusFi: the best trading community on the planet, with over 150,000 members Sign Up Now for Free
Genuine reviews from real traders, not fake reviews from stealth vendors
Quality education from leading professional traders
We are a friendly, helpful, and positive community
We do not tolerate rude behavior, trolling, or vendors advertising in posts
We are here to help, just let us know what you need
You'll need to register in order to view the content of the threads and start contributing to our community. It's free for basic access, or support us by becoming an Elite Member -- see if you qualify for a discount below.
-- Big Mike, Site Administrator
(If you already have an account, login at the top of the page)
First I am not a programmer but I have been learning and doing OK on that path.
I have written a script that does some correlation work of several other indicators and I want to
print out various output of that correlation on the chart, or in a table or in the MA.
I just want a list of the five outputs that are basically just a red or green long, short indication.
Currently I am using the Draw.TextFixed() call but this limits me to the four corners of the chart
for placement of the text.
What would I use to place the output in a list at some predefined area of the chart
Output one - Long
Output two - Short
Output three - Long
etc.
As always thanks for the input.
Mark
Can you help answer these questions from other members on NexusFi?
Hi markbb10, I suggest to first try to output your values to Output window, as shown in the attached image.
From there, you can copy& paste the values in your text editor (Notepad, Wordpad, MS Word etc) and save them.
I hope this helps.
Thanks for the suggestion but this will not accomplish what I am looking for. These values are
changing on every candle, so I want an easy way to visually look at all 5 conditions and
be able to ascertain an entry. Copying and pasting values will not work.
I have all the code written to produce the data I am just looking for the code to use to print those
values on the chart in a table.
Under SharpDX Text Rendering section - I believe it might do sort of what you are trying to achieve, or at least close - place some text at some arbitrary (x,y) coordinates.
Not sure if this will help - this code uses the .NET grid overlay stuff which I borrowed from someone else - I forget who.
I wanted on chart buttons but it also implements text. Essentially, the screen is split into predefined grid of cells and buttons/text can be created in any cell.
The code was never polished so apologies if it's not that clear.
The other way - probably simpler - which I also use, is to draw a block of text (Draw.Text) every bar at a fixed bar on the screen. I use a -ve bar offset so it appears at the right edge. Works for me.
If I understand correctly, I think you're just looking for a flexible placement of text on the actual chart. If that's the case, then why don't you use Draw.Text() instead of Draw.TextFixed()? With Draw.Text() you can line up the text above/below a given bar where it belongs and offset it as desired.
If you're looking to generate a multi-line text and print it all at once, then you can use string.Format and string concatenation (using + sign) and use the linefeed character \r (backslash r) to insert new lines in your text string.
I am experimenting with Draw.Text. I have this line of code running and acting as expected.
If I change the "candles back" parameter to 23 versus 22 it does not print. Can anyone explain
why? I have about 100 candles on the chart
Draw.Text(this,"drawtag1","Weis Wave - Red",22,Close[0],Brushes.Black); - This works
Draw.Text(this,"drawtag1","Weis Wave - Red",23,Close[0],Brushes.Black); - This does not
I want to thank everyone for their ideas and guidance. I am slowly learning more but I would be lying if I did not say it is driving me crazy.
Here is my latest issue. I have a short code snippet that will print the status of a indicator depending on the value of the variable called trend at a defined location on the chart.
In the format below I get printing of the status correctly in the defined locations. Please note that the first if statement is a Draw.TextFixed call and the second is Draw.Text.
if (trend == 1)
Draw.TextFixed(this,"status","Weis Wave is Green", TextPosition.TopRight,Brushes.White, ChartControl.Properties.LabelFont,Brushes.Black,Brushes.Green,100);
if (trend == -1)
Draw.Text(this,"drawtag1",false,"Weis Wave - Red",18,Close[0],-80,Brushes.Red,myFont,TextAlignment.Center,Brushes.Red,Brushes.LightGray,80);
If I change the first If statement to a Draw.Text, using proper syntax the indicator will compile without error but produces NOTHING on the screen. I have never seen anything more frustrating. Below is the code sequence that will compile but prints no data on the chart.
if (trend == 1)
Draw.Text(this,"drawtag1",false,"Weis Wave - Green",18,Close[0],-70, Brushes.Green,myFont, TextAlignment.Center,Brushes.Green,Brushes.LightGray,80);