Just A little help to finish !!! - NinjaTrader Programming | futures io social day trading
futures io futures trading


Just A little help to finish !!!
Updated: Views / Replies:1,075 / 9
Created: by Sadboybh Attachments:0

Welcome to futures io.

(If you already have an account, login at the top of the page)

futures io is the largest futures trading community on the planet, with over 90,000 members. At futures io, our goal has always been and always will be to create a friendly, positive, forward-thinking community where members can openly share and discuss everything the world of trading has to offer. The community is one of the friendliest you will find on any subject, with members going out of their way to help others. Some of the primary differences between futures io and other trading sites revolve around the standards of our community. Those standards include a code of conduct for our members, as well as extremely high standards that govern which partners we do business with, and which products or services we recommend to our members.

At futures io, our focus is on quality education. No hype, gimmicks, or secret sauce. The truth is: trading is hard. To succeed, you need to surround yourself with the right support system, educational content, and trading mentors Ė all of which you can find on futures io, utilizing our social trading environment.

With futures io, you can find honest trading reviews on brokers, trading rooms, indicator packages, trading strategies, and much more. Our trading review process is highly moderated to ensure that only genuine users are allowed, so you donít need to worry about fake reviews.

We are fundamentally different than most other trading sites:
  • We are here to help. Just let us know what you need.
  • We work extremely hard to keep things positive in our community.
  • We do not tolerate rude behavior, trolling, or vendors advertising in posts.
  • We firmly believe in and encourage sharing. The holy grail is within you, we can help you find it.
  • We expect our members to participate and become a part of the community. Help yourself by helping others.

You'll need to register in order to view the content of the threads and start contributing to our community.  It's free and simple.

-- Big Mike, Site Administrator

Reply
 
Thread Tools Search this Thread
 

Just A little help to finish !!!

  #1 (permalink)
Trading Apprentice
Bahrain
 
Futures Experience: Intermediate
Platform: Ninjatrader
Favorite Futures: Oil
 
Posts: 12 since May 2011
Thanks: 4 given, 0 received

Just A little help to finish !!!

Hi Guys,

I have finished programing this double SMA indicator with arrows when Crossover.
the only thing left and i struggled to add to this simple indicator is to make the fast SMA changes it's color to LIME when it's Crossabove the slow moving average and a RED color when it's crossBelow the slow moving average. I will post my script and i would appreciate it if anyone could help in coding the color changing of the fast moving average to finish this indicator
=====
#region Variables
// Wizard generated variables
private int average = 14; // Default setting for Average
private int trigger = 11; // Default setting for Trigger


// User defined variables (add any user defined variables below)

private Color buyArrowColor = Color.Lime;
private Color sellArrowColor = Color.Red;
#endregion

/// <summary>
/// This method is used to configure the indicator and is called once before any bar data is loaded.
/// </summary>
protected override void Initialize()
{
Add(new Plot(new Pen(Color.Blue,2f), PlotStyle.Line, "Avg"));
Add(new Plot(new Pen(Color.White,2f), PlotStyle.Line,"Trigger"));

Plots[1].Pen.DashStyle = DashStyle.Dash;


Overlay = true;
}

/// <summary>
/// Called on each bar update event (incoming tick)
/// </summary>
protected override void OnBarUpdate()
{
// Use this method for calculating your indicator values. Assign a value to each
// plot below by replacing 'Close[0]' with your own formula.
Avg.Set(SMA(Average)[0]);
Trg.Set(SMA(Trigger)[0]);

//buy condition:
if (CrossAbove(SMA(Trigger),SMA(Average),1))

DrawArrowUp("MyArrowUp"+CurrentBar,0, Avg[0],buyArrowColor);




//sell condition:
if (CrossBelow(SMA(Trigger),SMA(Average),1))
DrawArrowDown("MyArrowDn"+CurrentBar,0, Avg[0],sellArrowColor);
}

Reply With Quote
 
  #2 (permalink)
Quick Summary
Quick Summary Post

Quick Summary is created and edited by users like you... Add FAQ's, Links and other Relevant Information by clicking the edit button in the lower right hand corner of this message.

 
  #3 (permalink)
Site Administrator
Manta, Ecuador
 
Futures Experience: Advanced
Platform: My own custom solution
Favorite Futures: E-mini ES S&P 500
 
Big Mike's Avatar
 
Posts: 46,238 since Jun 2009
Thanks: 29,350 given, 83,220 received


Hi,

Did you try what I posted already in your other thread?:

Try watching @sam028's basic intro webinar on NT programming which covers multi color plots:
https://futures.io/elite-circle/10728-webinar-basic-ninjascript-coding-may-25th-4-30pm-eastern-22-30-berlin-paris.html

And/or @shodson's NT webinar which gives you the basic building blocks of C#:
https://futures.io/elite-circle/7980-webinar-introduction-c-ninjascript-programming-feb-23rd-1-00pm-eastern.html

Or look at any one of the hundreds of indicators on futures.io (formerly BMT) that have multicolor plots and look at the code and learn. This is the simplest.

Mike

Due to time constraints, please do not PM me if your question can be resolved or answered on the forum.

Need help?
1) Stop changing things. No new indicators, charts, or methods. Be consistent with what is in front of you first.
2) Start a journal and post to it daily with the trades you made to show your strengths and weaknesses.
3) Set goals for yourself to reach daily. Make them about how you trade, not how much money you make.
4) Accept responsibility for your actions. Stop looking elsewhere to explain away poor performance.
5) Where to start as a trader? Watch this webinar and read this thread for hundreds of questions and answers.
6)
Help using the forum? Watch this video to learn general tips on using the site.

If you want
to support our community, become an Elite Member.

Reply With Quote
The following 2 users say Thank You to Big Mike for this post:
 
  #4 (permalink)
Trading Apprentice
Bahrain
 
Futures Experience: Intermediate
Platform: Ninjatrader
Favorite Futures: Oil
 
Posts: 12 since May 2011
Thanks: 4 given, 0 received


Big Mike View Post
Hi,

Did you try what I posted already in your other thread?:

Try watching @sam028's basic intro webinar on NT programming which covers multi color plots:
https://futures.io/elite-circle/10728-webinar-basic-ninjascript-coding-may-25th-4-30pm-eastern-22-30-berlin-paris.html

And/or @shodson's NT webinar which gives you the basic building blocks of C#:
https://futures.io/elite-circle/7980-webinar-introduction-c-ninjascript-programming-feb-23rd-1-00pm-eastern.html

Or look at any one of the hundreds of indicators on futures.io (formerly BMT) that have multicolor plots and look at the code and learn. This is the simplest.

Mike

even though the videos aren't working with me, but thanks a lot Mike
beside I know what i needed was simple, but that's simple for you brother, you're experienced and professional @ it, for a starter guy like it will sound a little bit hard but don't worry mate I'll find out a way to get it working somehow.
BTW, i downloaded some muliticolors indicator from the forum and tried to see the code but unfortunately couldn't apply it on mine ..

thanks again

Reply With Quote
 
  #5 (permalink)
Site Administrator
Manta, Ecuador
 
Futures Experience: Advanced
Platform: My own custom solution
Favorite Futures: E-mini ES S&P 500
 
Big Mike's Avatar
 
Posts: 46,238 since Jun 2009
Thanks: 29,350 given, 83,220 received

If you are not a programmer, then best to hire your work done by a professional to get you started if you aren't willing to read books and example code and learn the language.

Mike

Due to time constraints, please do not PM me if your question can be resolved or answered on the forum.

Need help?
1) Stop changing things. No new indicators, charts, or methods. Be consistent with what is in front of you first.
2) Start a journal and post to it daily with the trades you made to show your strengths and weaknesses.
3) Set goals for yourself to reach daily. Make them about how you trade, not how much money you make.
4) Accept responsibility for your actions. Stop looking elsewhere to explain away poor performance.
5) Where to start as a trader? Watch this webinar and read this thread for hundreds of questions and answers.
6)
Help using the forum? Watch this video to learn general tips on using the site.

If you want
to support our community, become an Elite Member.

Reply With Quote
 
  #6 (permalink)
Elite Member
Dallas, TX
 
Futures Experience: Beginner
Platform: Ninjatrader
Broker/Data: Zen-Fire
Favorite Futures: ZN, 6E
 
gulabv's Avatar
 
Posts: 284 since May 2010
Thanks: 159 given, 155 received

Try this piece of code in your crossabove logic block:
PlotColors[0][1] = Color.Lime;

Try this piece of code in your crossbelow logic block:
PlotColors[0][1] = Color.Red;

Reply With Quote
 
  #7 (permalink)
Trading Apprentice
Bahrain
 
Futures Experience: Intermediate
Platform: Ninjatrader
Favorite Futures: Oil
 
Posts: 12 since May 2011
Thanks: 4 given, 0 received


gulabv View Post
Try this piece of code in your crossabove logic block:
PlotColors[0][1] = Color.Lime;

Try this piece of code in your crossbelow logic block:
PlotColors[0][1] = Color.Red;

Thanks for your advice gulabv, i've tried this code before and it compiles fine but, when i apply the indicator i cant see any moving average they just disappear !!!

Reply With Quote
 
  #8 (permalink)
Site Administrator
Manta, Ecuador
 
Futures Experience: Advanced
Platform: My own custom solution
Favorite Futures: E-mini ES S&P 500
 
Big Mike's Avatar
 
Posts: 46,238 since Jun 2009
Thanks: 29,350 given, 83,220 received


Sadboybh View Post
Thanks for your advice gulabv, i've tried this code before and it compiles fine but, when i apply the indicator i cant see any moving average they just disappear !!!

Attach your entire indicator .cs file and someone will more than likely help you by writing the code for you.

Mike

Due to time constraints, please do not PM me if your question can be resolved or answered on the forum.

Need help?
1) Stop changing things. No new indicators, charts, or methods. Be consistent with what is in front of you first.
2) Start a journal and post to it daily with the trades you made to show your strengths and weaknesses.
3) Set goals for yourself to reach daily. Make them about how you trade, not how much money you make.
4) Accept responsibility for your actions. Stop looking elsewhere to explain away poor performance.
5) Where to start as a trader? Watch this webinar and read this thread for hundreds of questions and answers.
6)
Help using the forum? Watch this video to learn general tips on using the site.

If you want
to support our community, become an Elite Member.

Reply With Quote
 
  #9 (permalink)
Elite Member
Berlin, Europe
 
Futures Experience: Advanced
Platform: NinjaTrader, MultiCharts
Broker/Data: Interactive Brokers
Favorite Futures: Keyboard
 
Fat Tails's Avatar
 
Posts: 9,651 since Mar 2010
Thanks: 4,226 given, 25,601 received
Forum Reputation: Legendary

CrossAbove) and CrossBelow() only define the bar, when the trigger crosses the average. To color you averages you do not want to use them, but use the simple conditions

 
Code
if (Trg[0] > Avg[0])
{     
   PlotColors[0][0] = Color.Lime;
   PlotColors[1][0] = Color.Lime;
}
else
{     
   PlotColors[0][0] = Color.Red;
   PlotColors[1][0] = Color.Red;
}

Reply With Quote
The following user says Thank You to Fat Tails for this post:
 
  #10 (permalink)
Trading Apprentice
Bahrain
 
Futures Experience: Intermediate
Platform: Ninjatrader
Favorite Futures: Oil
 
Posts: 12 since May 2011
Thanks: 4 given, 0 received



Fat Tails View Post
CrossAbove) and CrossBelow() only define the bar, when the trigger crosses the average. To color you averages you do not want to use them, but use the simple conditions

 
Code
if (Trg[0] > Avg[0])
{     
   PlotColors[0][0] = Color.Lime;
   PlotColors[1][0] = Color.Lime;
}
else
{     
   PlotColors[0][0] = Color.Red;
   PlotColors[1][0] = Color.Red;
}


Fat tails, thanks a lot bro, that's exactly what i was looking for, i really appreciate it

Reply With Quote

Reply



futures io > > > > > Just A little help to finish !!!

Thread Tools Search this Thread
Search this Thread:

Advanced Search



Upcoming Webinars and Events (4:30PM ET unless noted)

Linda Bradford Raschke: Reading The Tape

Elite only

Adam Grimes: TBA

Elite only

NinjaTrader: TBA

January

Ran Aroussi: TBA

Elite only
     


All times are GMT -4. The time now is 01:55 AM.

Copyright © 2017 by futures io, s.a., Av Ricardo J. Alfaro, Century Tower, Panama, +507 833-9432, info@futures.io
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.
no new posts
Page generated 2017-12-13 in 0.16 seconds with 18 queries on phoenix via your IP 54.92.201.232