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)
Looking for typical way to create a 'DataBox' on Price Panel
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
Can you help answer these questions from other members on NexusFi?
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?
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?
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.
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:
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.