Looking for typical way to create a 'DataBox' on Price Panel - futures io
futures io



Looking for typical way to create a 'DataBox' on Price Panel


Discussion in NinjaTrader

Updated
      Top Posters
    1. looks_one forrestang with 8 posts (1 thanks)
    2. looks_two Fat Tails with 3 posts (5 thanks)
    3. looks_3 Big Mike with 2 posts (1 thanks)
    4. looks_4 cory with 1 posts (1 thanks)
      Best Posters
    1. looks_one Fat Tails with 1.7 thanks per post
    2. looks_two cory with 1 thanks per post
    3. looks_3 Big Mike with 0.5 thanks per post
    4. looks_4 forrestang with 0.1 thanks per post
    1. trending_up 5,490 views
    2. thumb_up 8 thanks given
    3. group 4 followers
    1. forum 15 posts
    2. attach_file 4 attachments




Welcome to futures io: the largest futures trading community on the planet, with well over 125,000 members
  • 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 and simple.

-- Big Mike, Site Administrator

(If you already have an account, login at the top of the page)

 
Search this Thread
 

Looking for typical way to create a 'DataBox' on Price Panel

(login for full post details)
  #1 (permalink)
 forrestang 
Urban Samurai
Chicago IL
 
Experience: None
Platform: Ninja, MT4, Matlab
Broker: CQG, AMP, MB, DTN
Trading: E/U, G/U
 
forrestang's Avatar
 
Posts: 1,227 since Jun 2010
Thanks: 302 given, 929 received

I'm creating an indicator, that so far just needs to display various information on the price panel.

If I had maybe 3-4 variables I would like to output to the screen, what would be a good way to do this? I would like to use a function that would somehow keep it together, so that when resizing bars or scrunching the chart together, all of the values do not get too close to each other, or loose their spacing.

If anyone knows of an indicator that has done this (I can't think of any), that might get me started as well.

Might look something like this pic.

Forrest

Attached Thumbnails
Click image for larger version

Name:	Prime2011-07-25_061115.png
Views:	127
Size:	15.1 KB
ID:	44483  
Started this thread Reply With Quote

Journal Challenge April 2021 results (now extended!):
Competing for $1800 in prizes from Jigsaw
looks_oneMaking a Living with the Microsby sstheo
(140 thanks from 20 posts)
looks_twoSalao's Journalby Salao
(45 thanks from 9 posts)
looks_3Deetee’s DAX Trading Journal (time based)by Deetee
(34 thanks from 15 posts)
looks_4Learning to Profit - A journey in algorithms and optionsby Syntax
(15 thanks from 12 posts)
looks_5Maybe a little bit different journalby Malykubo
(14 thanks from 13 posts)
 
Best Threads (Most Thanked)
in the last 7 days on futures io
Big Mike in Ecuador
75 thanks
Would You Sell Your System?
72 thanks
The Crude Dude Oil Trading System
53 thanks
The New Micro Contract - MICRO BITCOIN coming May 2021
25 thanks
futures io site changelog and issues/problem reporting
23 thanks
 
(login for full post details)
  #3 (permalink)
 forrestang 
Urban Samurai
Chicago IL
 
Experience: None
Platform: Ninja, MT4, Matlab
Broker: CQG, AMP, MB, DTN
Trading: E/U, G/U
 
forrestang's Avatar
 
Posts: 1,227 since Jun 2010
Thanks: 302 given, 929 received


I'm working with "DrawTextFixed("tag1", "shout", TextPosition.TopRight);" function now. So far does most of want I want.

Playing with it to see if I can get it organized on the charts the way that I want now.

Started this thread Reply With Quote
 
(login for full post details)
  #4 (permalink)
 forrestang 
Urban Samurai
Chicago IL
 
Experience: None
Platform: Ninja, MT4, Matlab
Broker: CQG, AMP, MB, DTN
Trading: E/U, G/U
 
forrestang's Avatar
 
Posts: 1,227 since Jun 2010
Thanks: 302 given, 929 received

Got it!

Just need to figure out how to round these numbers off. Then some formatting.

Attached Thumbnails
Click image for larger version

Name:	Prime2011-07-25_100246.png
Views:	100
Size:	23.0 KB
ID:	44531  
Started this thread Reply With Quote
 
(login for full post details)
  #5 (permalink)
 forrestang 
Urban Samurai
Chicago IL
 
Experience: None
Platform: Ninja, MT4, Matlab
Broker: CQG, AMP, MB, DTN
Trading: E/U, G/U
 
forrestang's Avatar
 
Posts: 1,227 since Jun 2010
Thanks: 302 given, 929 received

Wow!!! What are the odds?

I just had a power outage right as I was hitting the compile button.

My PC restarts, open the chart up, and the study still works.

But.... when I went to edit the strategy, there is NOT one line of code. This is frustrating. I don't know if I'm going to recreate this damn thing again?

Started this thread Reply With Quote
 
(login for full post details)
  #6 (permalink)
 forrestang 
Urban Samurai
Chicago IL
 
Experience: None
Platform: Ninja, MT4, Matlab
Broker: CQG, AMP, MB, DTN
Trading: E/U, G/U
 
forrestang's Avatar
 
Posts: 1,227 since Jun 2010
Thanks: 302 given, 929 received

LOL..... Damn!

And here are some pics showing the script running RIGHT NOW! I don't think I can recover anything. I have a post on ninja forums, I'm hoping there is some magical directory somewhere that may have captured something?

Attached Thumbnails
Click image for larger version

Name:	errir.png
Views:	77
Size:	71.9 KB
ID:	44543   Click image for larger version

Name:	errir2.png
Views:	82
Size:	31.8 KB
ID:	44544  
Started this thread Reply With Quote
 
(login for full post details)
  #7 (permalink)
 Big Mike 
Site Administrator
Swing Trader
Data Scientist & DevOps
Manta, Ecuador
 
Experience: Advanced
Platform: Custom solution
Trading: Futures & Crypto
 
Big Mike's Avatar
 
Posts: 49,984 since Jun 2009
Thanks: 32,458 given, 98,242 received

Check Round2TickSize (if I remember correctly) for easy rounding. You can also append .ToString("0.00") to the end of a variable to reformat it to two decimals for example.

As for your computer crash, check your temp folder location and check your NinjaTrader folder --- it likely creates a temp file and renames it once compiled. The compiled code is cached in the DLL it creates which is why it still works.

I am not sure where temp files are stored, you might have to check with NT support if not in your %temp% Windows path.

Mike

We're here to help -- just ask

For the best trading education, watch our webinars
Searching for trading reviews? Review this list

Follow us on Twitter, YouTube, and Facebook

Support our community as an Elite Member:
https://futures.io/elite/

Visit other sites? Please spread the word about your experience with our community!
Follow me on Twitter Visit my futures io Trade Journal Reply With Quote
 
(login for full post details)
  #8 (permalink)
 forrestang 
Urban Samurai
Chicago IL
 
Experience: None
Platform: Ninja, MT4, Matlab
Broker: CQG, AMP, MB, DTN
Trading: E/U, G/U
 
forrestang's Avatar
 
Posts: 1,227 since Jun 2010
Thanks: 302 given, 929 received


Big Mike View Post
Check Round2TickSize (if I remember correctly) for easy rounding. You can also append .ToString("0.00") to the end of a variable to reformat it to two decimals for example.

As for your computer crash, check your temp folder location and check your NinjaTrader folder --- it likely creates a temp file and renames it once compiled. The compiled code is cached in the DLL it creates which is why it still works.

I am not sure where temp files are stored, you might have to check with NT support if not in your %temp% Windows path.

Mike

I asked those guys over @ ninjaForums about the crash earlier and possible recovery from somewhere, and they told me I was SOL. I recreated my indicator, and *LUCKILY* since I was getting some help from @Fat Tails about referencing his indie, I had some code snippets I posted that allowed me to recreate the script rather quickly. Otherwise it would have taken me a bit longer. I guess that's why I typically post a lot as I am scripting so that I have a point of reference to help my thought process.

And about that crash.... what are the odds? Think about it, the only reason my code disappeared was b/c my script was compiling while the computer turned off. If I had gone to hit that compile button 3 seconds earlier, or 3 seconds later, my code wouldn't have disappeared. I could have heard a noise, or dropped the remote to my radio, or gotten a phone call, or browsed an interesting topic on a web browser, or received an email that I decided to open that what have caused a delay. What are the freaking odds?!?!?!

For the rounding, I wound up using the ROUND function I guess that is native to C# not a ninja type function. I wound up going with this:

 
Code
			//Round these numbers 
			skew[0] = Math.Round(skew[0], 4);
			stdDevSize[0] = Math.Round(stdDevSize[0], 4);
			skewPercent[0] = Math.Round(skewPercent[0], 2);

Started this thread Reply With Quote
The following user says Thank You to forrestang for this post:
 
(login for full post details)
  #9 (permalink)
 Big Mike 
Site Administrator
Swing Trader
Data Scientist & DevOps
Manta, Ecuador
 
Experience: Advanced
Platform: Custom solution
Trading: Futures & Crypto
 
Big Mike's Avatar
 
Posts: 49,984 since Jun 2009
Thanks: 32,458 given, 98,242 received

Instrument.Round2TickSize is what I was thinking before.

Mike

We're here to help -- just ask

For the best trading education, watch our webinars
Searching for trading reviews? Review this list

Follow us on Twitter, YouTube, and Facebook

Support our community as an Elite Member:
https://futures.io/elite/

Visit other sites? Please spread the word about your experience with our community!
Follow me on Twitter Visit my futures io Trade Journal Reply With Quote
The following user says Thank You to Big Mike for this post:
 
(login for full post details)
  #10 (permalink)
 Fat Tails 
Market Wizard
Berlin, Europe
 
Experience: Advanced
Platform: NinjaTrader, MultiCharts
Broker: Interactive Brokers
Trading: Keyboard
 
Fat Tails's Avatar
 
Posts: 9,855 since Mar 2010
Thanks: 4,238 given, 26,743 received



forrestang View Post
Wow!!! What are the odds?

I just had a power outage right as I was hitting the compile button.

My PC restarts, open the chart up, and the study still works.

But.... when I went to edit the strategy, there is NOT one line of code. This is frustrating. I don't know if I'm going to recreate this damn thing again?

When you code an indicator you have several options.

-> If it is half ready, you cannot compile it, but you can save it via F4. In this case it will still be there after a power outage.
-> Once you have terminated your work you can compile via F5.

Now, the problem is there if you do not finish your work. NinjaTrader will try to compile it and you will get a compiler error. For this case I have created a subdirectory WorkInProgress in My Documents \ NinjaTrader 7\ bin\Custom\Indicator folder. I simply drag the indicator into that directory and later retrieve it to continue my work.

Reply With Quote
The following 3 users say Thank You to Fat Tails for this post:
 
(login for full post details)
  #11 (permalink)
 lolu 
Lagos, Nigeria
 
Experience: Intermediate
Platform: NinjaTrader, SierraChart
Trading: Euro Currency & Oil
 
lolu's Avatar
 
Posts: 2,502 since Jun 2009
Thanks: 1,029 given, 1,664 received


forrestang View Post
And about that crash....

You don't seem to connect your machines to a backup power supply (UPS) .... your machines don't seem to have power protection; Right ?

In my part of the world, I have as my power protection equipment -----> Stabilizer/Surge Protector and Inverter/Charger System (a more efficient kinda UPS); and I don't use my machines if these protection equipment are defective.

Lolu

Visit my futures io Trade Journal Reply With Quote
 
(login for full post details)
  #12 (permalink)
 Fat Tails 
Market Wizard
Berlin, Europe
 
Experience: Advanced
Platform: NinjaTrader, MultiCharts
Broker: Interactive Brokers
Trading: Keyboard
 
Fat Tails's Avatar
 
Posts: 9,855 since Mar 2010
Thanks: 4,238 given, 26,743 received


forrestang View Post
I'm creating an indicator, that so far just needs to display various information on the price panel.

If I had maybe 3-4 variables I would like to output to the screen, what would be a good way to do this? I would like to use a function that would somehow keep it together, so that when resizing bars or scrunching the chart together, all of the values do not get too close to each other, or loose their spacing.

If anyone knows of an indicator that has done this (I can't think of any), that might get me started as well.

Might look something like this pic.

Forrest


Did not reed this meesage before. When you want to display a data box it gets interesting, when you define what you want to display.

Static Display: Only the information of the last bars of the chart is used to fill the data box.

Dynamic Display: The information displayed is retrieved from the last par painted on your chart. This means that when you scroll the chart back hoizontally, the information displayed changes in line with the data displayed.

To see the difference, please have a look at the following static and dynamic indicators:


Examples

Static: NinjaTrader default Regression Channel indicator. It calculates the values from the last bar processed by OnBarUpDate().
Dynamic: Regression Channel V2 (download section). It calculates the regression channel from the last values displayed on the chart.

Static: Percentage indicator on RelativeVolume V14 indicator.
Dynamic: VolatilityBands V37. The values displayed in the upper left corner are in line with the sessions and bars displayed on the chart. The indicator has a custom plot, all calculations performed are stored in DataSeries objects and then retrieved by accessing the values for the bars shown on the chart.

Reply With Quote
The following user says Thank You to Fat Tails for this post:
 
(login for full post details)
  #13 (permalink)
 forrestang 
Urban Samurai
Chicago IL
 
Experience: None
Platform: Ninja, MT4, Matlab
Broker: CQG, AMP, MB, DTN
Trading: E/U, G/U
 
forrestang's Avatar
 
Posts: 1,227 since Jun 2010
Thanks: 302 given, 929 received

@Fat Tails

If I wanted to create a Data Box, that will always remain in a fixed position on the chart, AND have control over the color/font of text via some condition I have, is this possible?

-----EDIT----
Looks like it needs custom databox and override of plot function. I will have to figure this out.

Started this thread Reply With Quote
 
(login for full post details)
  #14 (permalink)
 cory 
the coin hunter
virginia
 
Experience: Intermediate
Platform: ninja
Trading: NQ
 
cory's Avatar
 
Posts: 6,042 since Jun 2009
Thanks: 854 given, 7,910 received

text box tip

Reply With Quote
The following user says Thank You to cory for this post:
 
(login for full post details)
  #15 (permalink)
 forrestang 
Urban Samurai
Chicago IL
 
Experience: None
Platform: Ninja, MT4, Matlab
Broker: CQG, AMP, MB, DTN
Trading: E/U, G/U
 
forrestang's Avatar
 
Posts: 1,227 since Jun 2010
Thanks: 302 given, 929 received


cory View Post
text box tip

Thanks Cory.

I've got the text box by itself working. I've used that before.

Two problems with that though:
1.) I have a text box with several variables in it. And I would like to be able to control the colors of each variable individually.

2.) If I create several text boxes, it will probably not maintain that nice spacing. So that if a user decides to rescale his chart, or blow it up fullscreen, the variables will overlap, or seperate, looking kinda sloppy.

I edited my post above, in that I will probably just have to learn how to create a custom data box and over ride the plot function (thats what someone suggested on the NT forum).

Started this thread Reply With Quote
 
(login for full post details)
  #16 (permalink)
 Fat Tails 
Market Wizard
Berlin, Europe
 
Experience: Advanced
Platform: NinjaTrader, MultiCharts
Broker: Interactive Brokers
Trading: Keyboard
 
Fat Tails's Avatar
 
Posts: 9,855 since Mar 2010
Thanks: 4,238 given, 26,743 received


forrestang View Post
@ Fat Tails

If I wanted to create a Data Box, that will always remain in a fixed position on the chart, AND have control over the color/font of text via some condition I have, is this possible?

-----EDIT----
Looks like it needs custom databox and override of plot function. I will have to figure this out.

Correct. THe easiest way is to code an indicator with a custom plot. An example for such an indicator is the SessioVolatilityBands. It plots a small data box in the upper left corner of the chart. The data box can also be displayed in the upper right corner of the chart. Of course it is possible to plot a stand-alone data box with a different text font and different colors somewhere else on the chart.

Reply With Quote
The following user says Thank You to Fat Tails for this post:


futures io Trading Community Platforms and Indicators NinjaTrader > Looking for typical way to create a 'DataBox' on Price Panel


Last Updated on September 7, 2011


Upcoming Webinars and Events
 

NinjaTrader Indicator Challenge!

Ongoing
 

Journal Challenge w/$1,800 in prizes!

April

Seven Trading Mistakes Solved With Smart Trading Tools w/Brannigan Barrett

Elite only
     



Copyright © 2021 by futures io, s.a., Av Ricardo J. Alfaro, Century Tower, Panama, +507 833-9432, info@futures.io
All information is for educational use only and is not investment advice.
There is a substantial risk of loss in trading commodity futures, stocks, options and foreign exchange products. Past performance is not indicative of future results.
no new posts