NexusFi: Find Your Edge


Home Menu

 





Custom BarType - PropertyDescriptor


Discussion in NinjaTrader

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




 
Search this Thread

Custom BarType - PropertyDescriptor

  #1 (permalink)
 bukkan 
Calcutta, India
 
Experience: Intermediate
Platform: ArthaChitra
Posts: 278 since Jun 2009
Thanks Given: 161
Thanks Received: 271

hi folks,
I am trying to develop a custom bartype. now i want to place a datetimepicker in the property descriptor. can anybody throw some light on how to do the same as i am stuck on that part.

thanks in advance.

Attached Thumbnails
Click image for larger version

Name:	Custom Bars.PNG
Views:	152
Size:	38.0 KB
ID:	18589  
Started this thread Reply With Quote

Can you help answer these questions
from other members on NexusFi?
ZombieSqueeze
Platforms and Indicators
Pivot Indicator like the old SwingTemp by Big Mike
NinjaTrader
Trade idea based off three indicators.
Traders Hideout
MC PL editor upgrade
MultiCharts
Exit Strategy
NinjaTrader
 
Best Threads (Most Thanked)
in the last 7 days on NexusFi
Diary of a simple price action trader
26 thanks
Just another trading journal: PA, Wyckoff & Trends
23 thanks
Tao te Trade: way of the WLD
20 thanks
My NQ Trading Journal
19 thanks
HumbleTraders next chapter
9 thanks
  #3 (permalink)
 
aslan's Avatar
 aslan 
Madison, WI
 
Experience: Advanced
Platform: ALT
Trading: ES
Posts: 625 since Jan 2010
Thanks Given: 356
Thanks Received: 1,127


Sorry, I don't know how to add a DateTime, but I think you will have to play with this routine:

 
Code
public override PropertyDescriptorCollection GetProperties(PropertyDescriptor propertyDescriptor, Period period, Attribute[] attributes)
{
	PropertyDescriptorCollection properties = base.GetProperties(propertyDescriptor, period, attributes);

	// here is how you remove properties not needed for that particular bars type
	properties.Remove(properties.Find("BasePeriodType", true));
	properties.Remove(properties.Find("BasePeriodValue", true));
	properties.Remove(properties.Find("PointAndFigurePriceType", true));
	properties.Remove(properties.Find("ReversalType", true));
	properties.Remove(properties.Find("Value2", true));

	// here is how you change the display name of the property on the properties grid
	Gui.Design.DisplayNameAttribute.SetDisplayName(properties, "Value", "\rBrick size");

	return properties;
}
This example shows how to remove and rename properties. To Add one, there is an Add method, but I am not sure on the syntax to create a PropertyDescriptor. Hope that helps.

Reply With Quote
Thanked by:
  #4 (permalink)
 bukkan 
Calcutta, India
 
Experience: Intermediate
Platform: ArthaChitra
Posts: 278 since Jun 2009
Thanks Given: 161
Thanks Received: 271


aslan View Post
Sorry, I don't know how to add a DateTime, but I think you will have to play with this routine:

 
Code
public override PropertyDescriptorCollection GetProperties(PropertyDescriptor propertyDescriptor, Period period, Attribute[] attributes)
{
    PropertyDescriptorCollection properties = base.GetProperties(propertyDescriptor, period, attributes);

    // here is how you remove properties not needed for that particular bars type
    properties.Remove(properties.Find("BasePeriodType", true));
    properties.Remove(properties.Find("BasePeriodValue", true));
    properties.Remove(properties.Find("PointAndFigurePriceType", true));
    properties.Remove(properties.Find("ReversalType", true));
    properties.Remove(properties.Find("Value2", true));

    // here is how you change the display name of the property on the properties grid
    Gui.Design.DisplayNameAttribute.SetDisplayName(properties, "Value", "\rBrick size");

    return properties;
}
This example shows how to remove and rename properties. To Add one, there is an Add method, but I am not sure on the syntax to create a PropertyDescriptor. Hope that helps.

ya i fiddled with that part, but sadly i too couldnt figure out the exact syntax for the propertydescriptor.

Started this thread Reply With Quote
  #5 (permalink)
 
aslan's Avatar
 aslan 
Madison, WI
 
Experience: Advanced
Platform: ALT
Trading: ES
Posts: 625 since Jan 2010
Thanks Given: 356
Thanks Received: 1,127

I think you are venturing into the grey area of unsupported in Ninja. They exposed the bar formation code, but don't really tell you how to go about it. Being able to add your own properties would really be helpful in BarTypes and ChartStyles. This is one of those cases, where posting the Ninja forum might help. Tell them what you are doing, and ask if they can give you a "hint" on how to add a property of type DateTime, int, string, etc. They may decline or might give you something to get you started. You could also try asking Roonius, who works for them now. If anyone knows how to do it, he probably would be it.

Reply With Quote
Thanked by:
  #6 (permalink)
 bukkan 
Calcutta, India
 
Experience: Intermediate
Platform: ArthaChitra
Posts: 278 since Jun 2009
Thanks Given: 161
Thanks Received: 271

well as you said its the gray area, and dont we know the answer of nt support such gray area

but as Ray promised during the bmt webinar that these stuffs will be supported on a later date. so i might just wait a little.

thanks.

Started this thread Reply With Quote




Last Updated on August 14, 2010


© 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