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



Just A little help to finish !!!


Discussion in NinjaTrader

Updated
      Top Posters
    1. looks_one Sadboybh with 4 posts (0 thanks)
    2. looks_two Big Mike with 3 posts (2 thanks)
    3. looks_3 Quick Summary with 1 posts (0 thanks)
    4. looks_4 gulabv with 1 posts (0 thanks)
    1. trending_up 1,566 views
    2. thumb_up 3 thanks given
    3. group 3 followers
    1. forum 9 posts
    2. attach_file 0 attachments




Welcome to futures io: the largest futures trading community on the planet, with well over 125,000 members
  • Genuine reviews from real traders, not fake reviews from stealth vendors
  • Quality education from leading professional traders
  • We are a friendly, helpful, and positive community
  • We do not tolerate rude behavior, trolling, or vendors advertising in posts
  • We are here to help, just let us know what you need
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

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

 
Search this Thread
 

Just A little help to finish !!!

(login for full post details)
  #1 (permalink)
Sadboybh
Bahrain
 
 
Posts: 12 since May 2011
Thanks: 4 given, 0 received

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

Can you help answer these questions
from other members on futures io?
Is there inherently more opportunity in smaller markets?
Traders Hideout
1 min chart v-shape scan help please
ThinkOrSwim
For the experts of Metastock
Platforms and Indicators
TradingView help in improving Anchored Vwap
Platforms and Indicators
TD Sequential for NT or MW?
Platforms and Indicators
 
 
(login for full post details)
  #3 (permalink)
 Big Mike 
Site Administrator
Swing Trader
Data Scientist & DevOps
Manta, Ecuador
 
Experience: Advanced
Platform: Custom solution
Trading: Futures & Crypto
 
Big Mike's Avatar
 
Posts: 50,129 since Jun 2009
Thanks: 32,601 given, 98,784 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:


And/or @shodson's NT webinar which gives you the basic building blocks of C#:


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

We're here to help -- just ask

For the best trading education, watch our webinars
Searching for trading reviews? Review this list

Follow us on Twitter, YouTube, and Facebook

Support our community as an Elite Member:
https://futures.io/elite/

Visit other sites? Please spread the word about your experience with our community!
Follow me on Twitter Visit my futures io Trade Journal Reply With Quote
The following 2 users say Thank You to Big Mike for this post:
 
(login for full post details)
  #4 (permalink)
Sadboybh
Bahrain
 
 
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:


And/or @ shodson's NT webinar which gives you the basic building blocks of C#:


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
 
(login for full post details)
  #5 (permalink)
 Big Mike 
Site Administrator
Swing Trader
Data Scientist & DevOps
Manta, Ecuador
 
Experience: Advanced
Platform: Custom solution
Trading: Futures & Crypto
 
Big Mike's Avatar
 
Posts: 50,129 since Jun 2009
Thanks: 32,601 given, 98,784 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

We're here to help -- just ask

For the best trading education, watch our webinars
Searching for trading reviews? Review this list

Follow us on Twitter, YouTube, and Facebook

Support our community as an Elite Member:
https://futures.io/elite/

Visit other sites? Please spread the word about your experience with our community!
Follow me on Twitter Visit my futures io Trade Journal Reply With Quote
 
(login for full post details)
  #6 (permalink)
 gulabv 
Dallas, TX
 
Experience: Beginner
Platform: Ninjatrader
Broker: Zen-Fire
Trading: ZN, 6E
 
gulabv's Avatar
 
Posts: 286 since May 2010
Thanks: 161 given, 167 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
 
(login for full post details)
  #7 (permalink)
Sadboybh
Bahrain
 
 
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
 
(login for full post details)
  #8 (permalink)
 Big Mike 
Site Administrator
Swing Trader
Data Scientist & DevOps
Manta, Ecuador
 
Experience: Advanced
Platform: Custom solution
Trading: Futures & Crypto
 
Big Mike's Avatar
 
Posts: 50,129 since Jun 2009
Thanks: 32,601 given, 98,784 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

We're here to help -- just ask

For the best trading education, watch our webinars
Searching for trading reviews? Review this list

Follow us on Twitter, YouTube, and Facebook

Support our community as an Elite Member:
https://futures.io/elite/

Visit other sites? Please spread the word about your experience with our community!
Follow me on Twitter Visit my futures io Trade Journal Reply With Quote
 
(login for full post details)
  #9 (permalink)
 Fat Tails 
Berlin, Europe
 
Experience: Advanced
Platform: NinjaTrader, MultiCharts
Broker: Interactive Brokers
Trading: Keyboard
 
Fat Tails's Avatar
 
Posts: 9,858 since Mar 2010
Thanks: 4,238 given, 26,770 received

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:
 
(login for full post details)
  #10 (permalink)
Sadboybh
Bahrain
 
 
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


futures io Trading Community Platforms and Indicators NinjaTrader > Just A little help to finish !!!


Last Updated on June 19, 2011


Upcoming Webinars and Events
 

NinjaTrader Indicator Challenge!

Ongoing
 

Our 12-year anniversary w/ $$,$$$ prizes (check soon)

August
     



Copyright © 2021 by futures io, s.a., Av Ricardo J. Alfaro, Century Tower, Panama, Ph: +507 833-9432 (Panama and Intl), +1 888-312-3001 (USA and Canada), 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