NexusFi: Find Your Edge


Home Menu

 





Programming for dummies - Help


Discussion in NinjaTrader

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




 
Search this Thread

Programming for dummies - Help

  #1 (permalink)
 
Ausy Mick's Avatar
 Ausy Mick 
Florida
 
Experience: Intermediate
Platform: NinjaTrader
Trading: ES
Posts: 69 since Jun 2009
Thanks Given: 45
Thanks Received: 65

Hi guys

All this effort from Sharky and his team has got me inspired, and so this weekend I
attempted to create my first indicator. The only problem is that I can not program my
way out of a brown paper bag.... . So I request some help.

After a couple of hours i finally figured out the drawarrow command and when certain
conditions are met I have the following code

DrawArrowUp("My arrow" + CurrentBar.ToString() , true, 0, High[0] + (TickSize *3), Color.Green);

My question is this: Is there a way to code it so that you can select the color of the
arrow from the indicator panel. (i.e making the color of the arrow a variable?)

From what I have seen in other indicators is that they have the following code
underneath the end region of the variables section.

Private Color barColorUp = Color.Blue

and in the Properties section the code

[Description(Color of Bars)]
[Category("Visual")]
public Color BarColorUp
{
get {return barColorUp;}
set {barColorUp = value;}
}

I have tried to cut paste this code but it always gives errors on compile. Any recommendations ?

Appreciate the help - Mick

Started this thread Reply With Quote

Can you help answer these questions
from other members on NexusFi?
Trade idea based off three indicators.
Traders Hideout
How to apply profiles
Traders Hideout
Better Renko Gaps
The Elite Circle
Pivot Indicator like the old SwingTemp by Big Mike
NinjaTrader
NT7 Indicator Script Troubleshooting - Camarilla Pivots
NinjaTrader
 
Best Threads (Most Thanked)
in the last 7 days on NexusFi
Spoo-nalysis ES e-mini futures S&P 500
41 thanks
Just another trading journal: PA, Wyckoff & Trends
30 thanks
Tao te Trade: way of the WLD
24 thanks
Bigger Wins or Fewer Losses?
23 thanks
GFIs1 1 DAX trade per day journal
21 thanks
  #2 (permalink)
 
sam028's Avatar
 sam028 
Site Moderator
 
Posts: 3,765 since Jun 2009
Thanks Given: 3,825
Thanks Received: 4,629

You piece of code looks good, what is exactly the error ?
Are your sure the error is in this indicator ?

Follow me on Twitter Reply With Quote
  #3 (permalink)
 
Ausy Mick's Avatar
 Ausy Mick 
Florida
 
Experience: Intermediate
Platform: NinjaTrader
Trading: ES
Posts: 69 since Jun 2009
Thanks Given: 45
Thanks Received: 65


Hi Sam

I get error message:

System.Drawing.Color does not contain a definition for barColorUp - CS 0117

I will post the code in just a bit

Thanks for the help

Started this thread Reply With Quote
  #4 (permalink)
 
Saroj's Avatar
 Saroj 
Arcata, CA
 
Experience: Intermediate
Platform: NinjaTrader
Trading: index futures, oil
Posts: 485 since Jun 2009
Thanks Given: 232
Thanks Received: 415

do you have barColorUp defined (I think as integer, but you have to check) either in the variables section or in the procedure section?

Reply With Quote
  #5 (permalink)
 
Saroj's Avatar
 Saroj 
Arcata, CA
 
Experience: Intermediate
Platform: NinjaTrader
Trading: index futures, oil
Posts: 485 since Jun 2009
Thanks Given: 232
Thanks Received: 415

Here's a different way of doing it that gives user access to all the plot properties...

Its a ".cs" file so you have to copy it into the NT indicators folder and then compile... (open anything and click "compile")... can't remember if NT will allow you to open this one until compiled... just try it and see...

You may already have this cs file... its a common one.

Actually this indicator is pretty cool because it paints a diff color if slope is good.

Attached Files
Elite Membership required to download: SMA_Colors.cs
Reply With Quote
  #6 (permalink)
 
Ausy Mick's Avatar
 Ausy Mick 
Florida
 
Experience: Intermediate
Platform: NinjaTrader
Trading: ES
Posts: 69 since Jun 2009
Thanks Given: 45
Thanks Received: 65

Here is the code - the cs file has the error

and two screenshots


Thanks again ...

Attached Thumbnails
Click image for larger version

Name:	Capture1.JPG
Views:	129
Size:	92.7 KB
ID:	2460   Click image for larger version

Name:	Capture2.JPG
Views:	113
Size:	83.6 KB
ID:	2461  
Attached Files
Elite Membership required to download: BlineBoogie.cs
Started this thread Reply With Quote
  #7 (permalink)
 
Ausy Mick's Avatar
 Ausy Mick 
Florida
 
Experience: Intermediate
Platform: NinjaTrader
Trading: ES
Posts: 69 since Jun 2009
Thanks Given: 45
Thanks Received: 65

Thanks Saroj,

I will import and try that ....

Started this thread Reply With Quote
  #8 (permalink)
 
Saroj's Avatar
 Saroj 
Arcata, CA
 
Experience: Intermediate
Platform: NinjaTrader
Trading: index futures, oil
Posts: 485 since Jun 2009
Thanks Given: 232
Thanks Received: 415

Ausy... I didn't realize you were doing triangles... I'm a beginner on the coding thing too.. searching for an example for triangles... meantime sam or another experienced code might tell you what's wrong.

Reply With Quote
  #9 (permalink)
 
sam028's Avatar
 sam028 
Site Moderator
 
Posts: 3,765 since Jun 2009
Thanks Given: 3,825
Thanks Received: 4,629


Ausy Mick View Post
Thanks Saroj,

I will import and try that ....

Line 54:

DrawArrowUp("My arrow" + CurrentBar.ToString() ,true, 0,Low[0]- (TickSize * 3) ,barColorUp);

and not

DrawArrowUp("My arrow" + CurrentBar.ToString() ,true, 0,Low[0]- (TickSize * 3) ,Color.barColorUp);

Follow me on Twitter Reply With Quote
Thanked by:
  #10 (permalink)
 
Ausy Mick's Avatar
 Ausy Mick 
Florida
 
Experience: Intermediate
Platform: NinjaTrader
Trading: ES
Posts: 69 since Jun 2009
Thanks Given: 45
Thanks Received: 65


BIG THANK YOU to both of you guys.....

Got it working .....

You made my day !



Just another reason why futures.io (formerly BMT) rocks - traders helping traders

Started this thread Reply With Quote




Last Updated on September 21, 2009


© 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