NexusFi: Find Your Edge


Home Menu

 





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 6,820 views
    2. thumb_up 8 thanks given
    3. group 4 followers
    1. forum 15 posts
    2. attach_file 4 attachments




 
Search this Thread

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

  #1 (permalink)
 
forrestang's Avatar
 forrestang 
Chicago IL
 
Experience: None
Platform: Ninja, MT4, Matlab
Broker: CQG, AMP, MB, DTN
Trading: E/U, G/U
Posts: 1,329 since Jun 2010
Thanks Given: 354
Thanks Received: 1,047

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:	248
Size:	15.1 KB
ID:	44483  
Started this thread Reply With Quote

Can you help answer these questions
from other members on NexusFi?
Deepmoney LLM
Elite Quantitative GenAI/LLM
Futures True Range Report
The Elite Circle
My NT8 Volume Profile Split by Asian/Euro/Open
NinjaTrader
NT7 Indicator Script Troubleshooting - Camarilla Pivots
NinjaTrader
Exit Strategy
NinjaTrader
 
  #3 (permalink)
 
forrestang's Avatar
 forrestang 
Chicago IL
 
Experience: None
Platform: Ninja, MT4, Matlab
Broker: CQG, AMP, MB, DTN
Trading: E/U, G/U
Posts: 1,329 since Jun 2010
Thanks Given: 354
Thanks Received: 1,047


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
  #4 (permalink)
 
forrestang's Avatar
 forrestang 
Chicago IL
 
Experience: None
Platform: Ninja, MT4, Matlab
Broker: CQG, AMP, MB, DTN
Trading: E/U, G/U
Posts: 1,329 since Jun 2010
Thanks Given: 354
Thanks Received: 1,047

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:	227
Size:	23.0 KB
ID:	44531  
Started this thread Reply With Quote
  #5 (permalink)
 
forrestang's Avatar
 forrestang 
Chicago IL
 
Experience: None
Platform: Ninja, MT4, Matlab
Broker: CQG, AMP, MB, DTN
Trading: E/U, G/U
Posts: 1,329 since Jun 2010
Thanks Given: 354
Thanks Received: 1,047

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
  #6 (permalink)
 
forrestang's Avatar
 forrestang 
Chicago IL
 
Experience: None
Platform: Ninja, MT4, Matlab
Broker: CQG, AMP, MB, DTN
Trading: E/U, G/U
Posts: 1,329 since Jun 2010
Thanks Given: 354
Thanks Received: 1,047

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:	209
Size:	71.9 KB
ID:	44543   Click image for larger version

Name:	errir2.png
Views:	210
Size:	31.8 KB
ID:	44544  
Started this thread Reply With Quote
  #7 (permalink)
 
Big Mike's Avatar
 Big Mike 
Manta, Ecuador
Site Administrator
Developer
Swing Trader
 
Experience: Advanced
Platform: Custom solution
Broker: IBKR
Trading: Stocks & Futures
Frequency: Every few days
Duration: Weeks
Posts: 50,399 since Jun 2009
Thanks Given: 33,175
Thanks Received: 101,541

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 the community or contact our Help Desk

Quick Links: Change your Username or Register as a Vendor
Searching for trading reviews? Review this list
Lifetime Elite Membership: Sign-up for only $149 USD
Exclusive money saving offers from our Site Sponsors: Browse Offers
Report problems with the site: Using the NexusFi changelog thread
Follow me on Twitter Visit my NexusFi Trade Journal Reply With Quote
  #8 (permalink)
 
forrestang's Avatar
 forrestang 
Chicago IL
 
Experience: None
Platform: Ninja, MT4, Matlab
Broker: CQG, AMP, MB, DTN
Trading: E/U, G/U
Posts: 1,329 since Jun 2010
Thanks Given: 354
Thanks Received: 1,047


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
Thanked by:
  #9 (permalink)
 
Big Mike's Avatar
 Big Mike 
Manta, Ecuador
Site Administrator
Developer
Swing Trader
 
Experience: Advanced
Platform: Custom solution
Broker: IBKR
Trading: Stocks & Futures
Frequency: Every few days
Duration: Weeks
Posts: 50,399 since Jun 2009
Thanks Given: 33,175
Thanks Received: 101,541

Instrument.Round2TickSize is what I was thinking before.

Mike

We're here to help: just ask the community or contact our Help Desk

Quick Links: Change your Username or Register as a Vendor
Searching for trading reviews? Review this list
Lifetime Elite Membership: Sign-up for only $149 USD
Exclusive money saving offers from our Site Sponsors: Browse Offers
Report problems with the site: Using the NexusFi changelog thread
Follow me on Twitter Visit my NexusFi Trade Journal Reply With Quote
Thanked by:
  #10 (permalink)
 
Fat Tails's Avatar
 Fat Tails 
Berlin, Europe
Market Wizard
 
Experience: Advanced
Platform: NinjaTrader, MultiCharts
Broker: Interactive Brokers
Trading: Keyboard
Posts: 9,888 since Mar 2010
Thanks Given: 4,242
Thanks Received: 27,102



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
Thanked by:




Last Updated on September 7, 2011


© 2024 NexusFi™, s.a., All Rights Reserved.
Av Ricardo J. Alfaro, Century Tower, Panama City, Panama, Ph: +507 833-9432 (Panama and Intl), +1 888-312-3001 (USA and Canada)
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.
About Us - Contact Us - Site Rules, Acceptable Use, and Terms and Conditions - Privacy Policy - Downloads - Top
no new posts