Big Mike's Trading Blog

Day trading futures, discussing money management and trade management techniques, and more

Adding a score graph to your chart

As you know, I like to score trades.  Say you measure 10 different things, and maybe some have more weight than others, then you arrive at a total score to help you decide how to trade.

I usually just output the score in text form, but I wrote a quick way to graphically illustrate it.


             if (score > 0)
            {
                //infotext = " LONG: ";
                int x = 0;
                while (x < score)
                {
                    infotext += "▓";  // alt-178
                    x++;
                }
               
                infocolor = Color.CornflowerBlue;
            }
           
            if (score < 0)
            {
                //infotext = " SHORT: ";
                score = score-score-score;  // turns a negative score to a positive one
                int x = 0;
                while (x < score)
                {
                    infotext += "▓"; // alt-178
                    x++;
                }
                infocolor = Color.Maroon;
            }
           
            //if (score == 0)
            //    infotext = " FLAT:";
           
            int y = 9; // maximum score
            while (y > score)
                {
                    infotext += "░"; // alt-176
                    y--;
                }
           
            DrawTextFixed("Info", infotext, TextPosition.BottomRight, Color.White, new Font("Arial", 8, FontStyle.Bold), infocolor, infocolor, 8);

           
So in practice this is what it looks like:

(flat)
(long, mid-score like 5 out of 10)
(short, high score 9 out of 10)

You might be seeing this on my future charts.  As with most everything, I am still tweaking it!

Mike

10 comments:

Big Mike said...

I wanted to confess a few obvious things...

First, I am not a great programmer (I just hack stuff together), so don't laugh at my code.

Second, I had a total brain fart and couldn't figure out a way to turn a negative number into a positive one, other than doing score-score-score. So feel free to tell me how to do it in a more elegant way.

Last, speaking of elegance, there is no doubt a way to use the graphics c# function to paint the screen in a more appropriate and modern method than using the old-school alt-176 method I've outlined. I would venture a guess that 99.9% of people have no idea what "alt-176" even means, but if you throw open notepad and hold down your alt key and using your numeric keypad type 176, you'll see what I mean. I'm just an old school kinda guy.

Mike

Mel said...

Hi Mike,

love the website and your videos. Keep up the good work!

Big Mike said...

Hi Mel,

Thank you! The blog is still very new, but I am working hard on it. Please help me spread the word and tell others!

Mike

Anonymous said...

Hi Mike,

Thanks for sharing your insights on your blog...I believe you can turn a negative number into a positive number by multiplying it by -1. I have very limited programming experience. How difficult would you say is NinjaScript is for a beginner?

Thanks,
Bryan R

Big Mike said...

Hi Bryan,

Yes multiplying by -1 does work, I was having issues with it because it is misinterpreted as "y _minus_ 1" instead of saying "y _times_ negative 1", literally.

NinjaScript is basically C#. So, that makes it very powerful, and a bit steep to step into from scratch.

But, they bundle a Wizard editor that can do quite a bit, it is really powerful, but I don't use it because it just gets in my way.

I suggest a few things: Edit (view) some code where you understand the end result, like the SMA indicator, and then try to see what it was doing internally. Then slowly work your way up to more complex stuff, just start viewing the code of everything you can get your hands on.

Before you know it you'll be writing your own code.

I also recommend you hire a Ninja programmer in the beginning if there is a project you have an idea for, and can put it to paper but not into C# (NinjaScript). I recommend Roonius on the Ninja forums, he is great.

Mike

iwannatoscript said...

Great job Mike,

you go on your way! :-)

roonius said...

score = -score will work

Big Mike said...

Thanks roonius, I will remember that one :)

Mike

Anonymous said...

can you post a zip of the alert to enter trades

Big Mike said...

Hello anonymous,

Yes I will include the sound files in my next blog post, look for them there.

Mike

Post a Comment

Note: Only a member of this blog may post a comment.

Platforms/Indicators

BMT - Traders Hideout

BMT - Programmers

BMT - Psychology

BMT - Journals