opacity - futures io
futures io futures trading



opacity


Discussion in NinjaTrader

Updated by SamirOfSalem
    1. trending_up 326 views
    2. thumb_up 0 thanks given
    3. group 2 followers
    1. forum 1 replies
    2. attach_file 0 attachments




Welcome to futures io: the largest futures trading community on the planet, with well over 100,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
 

opacity

(login for full post details)
  #1 (permalink)
Chicago
 
Experience: Intermediate
Platform: NinjaTrader
Broker: NinjaTrader Brokerage
Trading: FDAX, NQ, HG, SI, CL
 
Bullywig's Avatar
 
Posts: 54 since Oct 2015
Thanks: 32 given, 16 received

I would like to add opacity control to this simple indicator. Can someone point me in the right direction. What do I need to add?

public class StochFilter : Indicator
{
private StochasticsFast StochasticsFast1;
private StochasticsFast StochasticsFast2;
private StochasticsFast StochasticsFast3;

protected override void OnStateChange()
{
if (State == State.SetDefaults)
{
Description = @"Enter the description for your new custom Indicator here.";
Name = "StochFilter";
Calculate = Calculate.OnBarClose;
IsOverlay = false;
DisplayInDataBox = true;
DrawOnPricePanel = true;
DrawHorizontalGridLines = true;
DrawVerticalGridLines = true;
PaintPriceMarkers = true;
ScaleJustification = NinjaTrader.Gui.Chart.ScaleJustification.Right;
//Disable this property if your indicator requires custom values that cumulate with each new market data event.
//See Help Guide for additional information.
IsSuspendedWhileInactive = true;
}
else if (State == State.Configure)
{
}
else if (State == State.DataLoaded)
{
StochasticsFast1 = StochasticsFast(Close, 6, 13);
StochasticsFast2 = StochasticsFast(Close, 13, 25);
StochasticsFast3 = StochasticsFast(Close, 13, 25);
}
}

protected override void OnBarUpdate()
{
if (BarsInProgress != 0)
return;

if (CurrentBars[0] < 0)
return;

// Set 1
if ((StochasticsFast1.D[0] > StochasticsFast2.D[0])
&& (StochasticsFast3.D[0] < 80)
&& (StochasticsFast3.D[0] > 20))
{
BackBrush = Brushes.Green;
}

// Set 2
if (StochasticsFast3.D[0] > 80)
{
BackBrush = Brushes.Green;
}

// Set 3
if ((StochasticsFast1.D[0] < StochasticsFast2.D[0])
&& (StochasticsFast3.D[0] < 80)
&& (StochasticsFast3.D[0] > 20))
{
BackBrush = Brushes.Maroon;
}

// Set 4
if (StochasticsFast3.D[0] < 20)
{
BackBrush = Brushes.Maroon;
}
}
}
}

#region NinjaScript generated code. Neither change nor remove.

namespace NinjaTrader.NinjaScript.Indicators
{
public partial class Indicator : NinjaTrader.Gui.NinjaScript.IndicatorRenderBase
{
private StochFilter[] cacheStochFilter;
public StochFilter StochFilter()
{
return StochFilter(Input);
}

public StochFilter StochFilter(ISeries<double> input)
{
if (cacheStochFilter != null)
for (int idx = 0; idx < cacheStochFilter.Length; idx++)
if (cacheStochFilter[idx] != null && cacheStochFilter[idx].EqualsInput(input))
return cacheStochFilter[idx];
return CacheIndicator<StochFilter>(new StochFilter(), input, ref cacheStochFilter);
}
}
}

namespace NinjaTrader.NinjaScript.MarketAnalyzerColumns
{
public partial class MarketAnalyzerColumn : MarketAnalyzerColumnBase
{
public Indicators.StochFilter StochFilter()
{
return indicator.StochFilter(Input);
}

public Indicators.StochFilter StochFilter(ISeries<double> input )
{
return indicator.StochFilter(input);
}
}
}

namespace NinjaTrader.NinjaScript.Strategies
{
public partial class Strategy : NinjaTrader.Gui.NinjaScript.StrategyRenderBase
{
public Indicators.StochFilter StochFilter()
{
return indicator.StochFilter(Input);
}

public Indicators.StochFilter StochFilter(ISeries<double> input )
{
return indicator.StochFilter(input);
}
}
}

#endregion

Reply With Quote

Can you help answer these questions
from other members on futures io?
EQIX - Digital REITs - any experiences?
Stocks and ETFs
help to convert from thinkscript to ninjascript
NinjaTrader
DLL with webrequest function for MC
MultiCharts
Need a near crosses scan help for TOS
ThinkOrSwim
Horizontal Line Indicator
Platforms and Indicators
 
 
(login for full post details)
  #2 (permalink)
Dubai + United Arab Emirates
 
 
Posts: 9 since Jan 2020
Thanks: 3 given, 5 received

Hi Bullywig.

See if using Color.FromArgb() works.

for example:

 
Code
Brush Red33percent = new SolidColorBrush(Color.FromArgb(33, 255, 0, 0));
Red33percent.Freeze();

BackBrush = Red33percent;


Brush Blue44percent = new SolidColorBrush(Color.FromArgb(44, 0, 0, 255));
Blue44percent.Freeze();

BackBrush = Blue44percent;
You might need to dispose() the brushess upon termination.

Reply With Quote


futures io Trading Community Platforms and Indicators NinjaTrader > opacity


July 21, 2020


Upcoming Webinars and Events
 

Live Video Panel: Ask Me Anything w/Ironbeam Brokerage

Aug 6
     



Copyright © 2020 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