NexusFi: Find Your Edge


Home Menu

 





Null check indicator ideas for NT8


Discussion in NinjaTrader

Updated
    1. trending_up 1,239 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?
Trade idea based off three indicators.
Traders Hideout
Cheap historycal L1 data for stocks
Stocks and ETFs
Pivot Indicator like the old SwingTemp by Big Mike
NinjaTrader
REcommedations for programming help
Sierra Chart
How to apply profiles
Traders Hideout
 




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