NexusFi: Find Your Edge


Home Menu

 





Null check indicator ideas for NT8


Discussion in NinjaTrader

Updated
    1. trending_up 1,224 views
    2. thumb_up 2 thanks given
    3. group 2 followers
    1. forum 1 posts
    2. attach_file 1 attachments




 
Search this Thread

Null check indicator ideas for NT8

  #1 (permalink)
 
Sim22's Avatar
 Sim22 
Australia
 
Experience: Intermediate
Platform: NinjaTrader, MarketDelta
Trading: 6J, CL, GC
Posts: 43 since May 2010
Thanks Given: 52
Thanks Received: 123

One day I just had the sh*ts with NT8 having brush freezing/disposal issues when left idle for a while ie. possible multi-threading issues.
I decided to write some extension methods that might help with this. (Warning: these are not thoroughly tested!)

eg.

 
Code
                            
// normal code for freezing a brush
Brush myBrush Brushes.Red;
myBrush.Freeze(); 
I've written an extension that checks it for null before freezing it:

 
Code
                            
// extension code instead
Brush myBrush Brushes.Red;
myBrush.NotNullFreeze(); 
Also disposal of SharpDx objects:

 
Code
                            
SharpDx.Direct2D.Brush myBrushDx;

// Dispose by
if(myBrushDx != null)
      
myBrushDx.Dispose();

//Extension instead
myBrushDx.NotNullDispose(); 
I've also created an opacity extension:

 
Code
                            

Brush myBrush 
Brushes.Red;

myBrush myBrush.ChangeOpacity(int Opacity); // or double Opacity
myBrush.NotNullFreeze(); 
You can also use the 'NotNull' extension to check for null values within Linq statements. Please peruse the actual indicator for some ideas. You will find the extensions within the Addons folder called Sim22BrushExtensions and Sim22NotNullExtensions. The actual indicator does nothing, it's just for the code: Sim22_NullSample.

You need to make sure in the declarations you set: using Sim22BrushExtensions; using Sim22NotNullExtensions;

I'd appreciate anyone having a play and suggesting ideas. I won't be able to answer for a few days so I hope I wake to find some interesting comments

Attached Files
Elite Membership required to download: Sim22_NullSampleNT8.0.2Jan2017.zip
Started this thread Reply With Quote
Thanked by:

Can you help answer these questions
from other members on NexusFi?
NT7 Indicator Script Troubleshooting - Camarilla Pivots
NinjaTrader
My NT8 Volume Profile Split by Asian/Euro/Open
NinjaTrader
Exit Strategy
NinjaTrader
Futures True Range Report
The Elite Circle
New Micros: Ultra 10-Year & Ultra T-Bond -- Live Now
Treasury Notes and Bonds
 
Best Threads (Most Thanked)
in the last 7 days on NexusFi
Get funded firms 2023/2024 - Any recommendations or word …
61 thanks
Funded Trader platforms
39 thanks
NexusFi site changelog and issues/problem reporting
26 thanks
GFIs1 1 DAX trade per day journal
18 thanks
The Program
18 thanks




Last Updated on January 1, 2017


© 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