1 Signal from 3 Indicators - NinjaTrader Programming | futures io social day trading
futures io futures trading


1 Signal from 3 Indicators
Updated: Views / Replies:1,169 / 11
Created: by KrazyTrader 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
 

1 Signal from 3 Indicators

  #1 (permalink)
Elite Member
Dallas, TX/USA
 
Futures Experience: Intermediate
Platform: NinjaTrader
Favorite Futures: ES, CL
 
Posts: 46 since Aug 2013
Thanks: 52 given, 6 received

1 Signal from 3 Indicators

Hello,

I'm using @Fat Tails SuperTrend and Keltner for indicators.
I'm currently using something like this for background color:

// Long
if SuperTrend.UpTrend && Fast > Slow && Slow (rising)
{
BackGround Color UpColor
}
// Short is opposite and Neutral is everything else.

I had a breakthrough earlier this week when @Fat Tails showed me how to get SuperTrend simplified to STU=anaSuperTrend.etc,etc. Now I'm thinking conditions I have for background colors could trigger signals.

I'm hoping for something like-
LONG=SuperTrend.UpTrend && Fast > Slow && Slow (rising)

// Long
if LONG [1] = false && LONG [0]=true
{
LONG Signal
}

I'm willing to do my own fishing if someone can send me to the place.

Thanks in advance.

Difference between discomfort and pain = 1 tick
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)
Market Wizard
Houston, TX
 
Futures Experience: Intermediate
Platform: NinjaTrader
Broker/Data: Optimus Futures
Favorite Futures: 6E
 
TheWizard's Avatar
 
Posts: 1,711 since Jun 2009
Thanks: 509 given, 4,072 received



KrazyTrader View Post
Hello,

I'm using @Fat Tails SuperTrend and Keltner for indicators.
I'm currently using something like this for background color:

// Long
if SuperTrend.UpTrend && Fast > Slow && Slow (rising)
{
BackGround Color UpColor
}
// Short is opposite and Neutral is everything else.

I had a breakthrough earlier this week when @Fat Tails showed me how to get SuperTrend simplified to STU=anaSuperTrend.etc,etc. Now I'm thinking conditions I have for background colors could trigger signals.

I'm hoping for something like-
LONG=SuperTrend.UpTrend && Fast > Slow && Slow (rising)

// Long
if LONG [1] = false && LONG [0]=true
{
LONG Signal
}

I'm willing to do my own fishing if someone can send me to the place.

Thanks in advance.

@KrazyTrader,

For the Long / Short signal insert code:

BackColor = Color.FromArgb(opacity, Color.Blue); (ex: Long - Blue / Short - Red, or any other colors you prefer)

In the Variables section, insert code:

private int opacity = 100; (this allows you to control the opacity of the color; 10%, 20%, etc up to 100%)

In the Properties section, insert code:

[Description("Background opacity")]
[GridCategory("Parameters")]
public int Opacity
{
get { return opacity; }
set { opacity = (value); }
}


This defines the field called "opacity", which will pop up in the indicator preferences panel and allow you to specify the opacity percentage (10, 20, up to 100%)

Hope that helps.

After all, it's what you learn AFTER you know it all, that counts!
Reply With Quote
 
  #4 (permalink)
Elite Member
Dallas, TX/USA
 
Futures Experience: Intermediate
Platform: NinjaTrader
Favorite Futures: ES, CL
 
Posts: 46 since Aug 2013
Thanks: 52 given, 6 received


TheWizard View Post
@KrazyTrader,

For the Long / Short signal insert code:

BackColor = Color.FromArgb(opacity, Color.Blue); (ex: Long - Blue / Short - Red, or any other colors you prefer)

In the Variables section, insert code:

private int opacity = 100; (this allows you to control the opacity of the color; 10%, 20%, etc up to 100%)

In the Properties section, insert code:

[Description("Background opacity")]
[GridCategory("Parameters")]
public int Opacity
{
get { return opacity; }
set { opacity = (value); }
}


This defines the field called "opacity", which will pop up in the indicator preferences panel and allow you to specify the opacity percentage (10, 20, up to 100%)

Hope that helps.


Thanks,

Any way to code something that would work as a trade signal?

Difference between discomfort and pain = 1 tick
Reply With Quote
 
  #5 (permalink)
Market Wizard
Houston, TX
 
Futures Experience: Intermediate
Platform: NinjaTrader
Broker/Data: Optimus Futures
Favorite Futures: 6E
 
TheWizard's Avatar
 
Posts: 1,711 since Jun 2009
Thanks: 509 given, 4,072 received


KrazyTrader View Post
Thanks,

Any way to code something that would work as a trade signal?

@KrazyTrader,

I'd have to see the indicator you're talking about. Post it here, or send it to me in a Private Message and I'll take a look to see where to insert the code. There are plenty of indicators out there that generate trade signals. The question is - are they good signals?

After all, it's what you learn AFTER you know it all, that counts!
Reply With Quote
 
  #6 (permalink)
Elite Member
Dallas, TX/USA
 
Futures Experience: Intermediate
Platform: NinjaTrader
Favorite Futures: ES, CL
 
Posts: 46 since Aug 2013
Thanks: 52 given, 6 received


TheWizard View Post
@KrazyTrader,

I'd have to see the indicator you're talking about. Post it here, or send it to me in a Private Message and I'll take a look to see where to insert the code. There are plenty of indicators out there that generate trade signals. The question is - are they good signals?

Thanks in advance for taking your time to look at this.

First a disclaimer: This is more of a learning experience to improve my coding ability than me being set on a signal.

What i'm curious about... I would like to use the code in //ColorBars to create a signal like I have in //Long SetUp. My thinking is to create something like:
LONG =if (EMA(8)[0]> SMA (20)[0]&& STU.UpTrend [0]&& KU.Trend [0]> 0 )
and then i could use something like--
if LONG [1] == false && LONG [0]==true
{
DrawArrow/ or enter market or something!!
}
I don't know if what I'm asking is possible...but my limited knowledge has me thinking it would simplify/optimize signals and entries.

This is current state:

#region Variables
//SuperTrendU11
private double multiplier = 1.618;
private int rangePeriod = 3;
private int basePeriod = 3;
private anaSuperTrendU11BaseType thisBaseType = anaSuperTrendU11BaseType.Median;
private anaSuperTrendU11OffsetType thisOffsetType = anaSuperTrendU11OffsetType.Default;
private anaSuperTrendU11VolaType thisVolaType = anaSuperTrendU11VolaType.True_Range;
private anaSuperTrendU11 STU;

//Keltner Universal
private anaKeltnerUniversal KU;

protected override void OnStartUp()


// SuperTrend
STU = anaSuperTrendU11(basePeriod, multiplier, rangePeriod, false, thisBaseType, thisOffsetType, thisVolaType);
// Keltner
KU= anaKeltnerUniversal(20, anaKeltnerMAType.Median, anaKeltnerMAType.SMA, 2, 20, anaKeltnerRangeType.TrueRange, false, 30);



protected override void OnBarUpdate()
// ColorBars
if (EMA(8)[0]> SMA (20)[0]&& STU.UpTrend [0]&& KU.Trend [0]> 0 )
{
BarColor = barColorUp;
CandleOutlineColor = candleOutlineUp;

if (candles && Close[0] > Open[0])
BarColor = Color.FromArgb(opacityUp, BarColor);
}


// Long SetUp
if (KU.Trend [1] <= 0 && KU.Trend [0]>0 && Close [0] > SMA (20) [0]&& STU.UpTrend[0]
|| CrossAbove(EMA (8),SMA (20),1)&& STU.UpTrend[0]&& KU.Trend [0]> 0
|| STU.UpTrend[0]!= STU.UpTrend[1]&& Values[0][0] > Values[1][0]&& KU.Trend [0]> 0)
{
if (Arrows)
DrawArrowUp("arrow"+CurrentBar, true, 0, Open[0]-arrowOffset*TickSize, arrowColorUp);
if (SoundAlert)
Alert("CrossAbove",NinjaTrader.Cbi.Priority.Medium,"CrossAbove",upFile,rearmTime,Color.Navy,Color.Magenta);
}

Thanks again!

Difference between discomfort and pain = 1 tick
Reply With Quote
 
  #7 (permalink)
Market Wizard
Houston, TX
 
Futures Experience: Intermediate
Platform: NinjaTrader
Broker/Data: Optimus Futures
Favorite Futures: 6E
 
TheWizard's Avatar
 
Posts: 1,711 since Jun 2009
Thanks: 509 given, 4,072 received


KrazyTrader View Post
Thanks in advance for taking your time to look at this.

First a disclaimer: This is more of a learning experience to improve my coding ability than me being set on a signal.

What i'm curious about... I would like to use the code in //ColorBars to create a signal like I have in //Long SetUp. My thinking is to create something like:
LONG =if (EMA(8)[0]> SMA (20)[0]&& STU.UpTrend [0]&& KU.Trend [0]> 0 )
and then i could use something like--
if LONG [1] == false && LONG [0]==true
{
DrawArrow/ or enter market or something!!
}
I don't know if what I'm asking is possible...but my limited knowledge has me thinking it would simplify/optimize signals and entries.

This is current state:

#region Variables
//SuperTrendU11
private double multiplier = 1.618;
private int rangePeriod = 3;
private int basePeriod = 3;
private anaSuperTrendU11BaseType thisBaseType = anaSuperTrendU11BaseType.Median;
private anaSuperTrendU11OffsetType thisOffsetType = anaSuperTrendU11OffsetType.Default;
private anaSuperTrendU11VolaType thisVolaType = anaSuperTrendU11VolaType.True_Range;
private anaSuperTrendU11 STU;

//Keltner Universal
private anaKeltnerUniversal KU;

protected override void OnStartUp()


// SuperTrend
STU = anaSuperTrendU11(basePeriod, multiplier, rangePeriod, false, thisBaseType, thisOffsetType, thisVolaType);
// Keltner
KU= anaKeltnerUniversal(20, anaKeltnerMAType.Median, anaKeltnerMAType.SMA, 2, 20, anaKeltnerRangeType.TrueRange, false, 30);



protected override void OnBarUpdate()
// ColorBars
if (EMA(8)[0]> SMA (20)[0]&& STU.UpTrend [0]&& KU.Trend [0]> 0 )
{
BarColor = barColorUp;
CandleOutlineColor = candleOutlineUp;

if (candles && Close[0] > Open[0])
BarColor = Color.FromArgb(opacityUp, BarColor);
}


// Long SetUp
if (KU.Trend [1] <= 0 && KU.Trend [0]>0 && Close [0] > SMA (20) [0]&& STU.UpTrend[0]
|| CrossAbove(EMA (8),SMA (20),1)&& STU.UpTrend[0]&& KU.Trend [0]> 0
|| STU.UpTrend[0]!= STU.UpTrend[1]&& Values[0][0] > Values[1][0]&& KU.Trend [0]> 0)
{
if (Arrows)
DrawArrowUp("arrow"+CurrentBar, true, 0, Open[0]-arrowOffset*TickSize, arrowColorUp);
if (SoundAlert)
Alert("CrossAbove",NinjaTrader.Cbi.Priority.Medium,"CrossAbove",upFile,rearmTime,Color.Navy,Color.Magenta);
}

Thanks again!

@KrazyTrader,

It looks like you're on the right track. I don't see anything wrong with the code. You just need to decide what it is you want to do, and under what conditions you want to do it.

After all, it's what you learn AFTER you know it all, that counts!
Reply With Quote
The following user says Thank You to TheWizard for this post:
 
  #8 (permalink)
Elite Member
Dallas, TX/USA
 
Futures Experience: Intermediate
Platform: NinjaTrader
Favorite Futures: ES, CL
 
Posts: 46 since Aug 2013
Thanks: 52 given, 6 received


TheWizard View Post
@KrazyTrader,

It looks like you're on the right track. I don't see anything wrong with the code. You just need to decide what it is you want to do, and under what conditions you want to do it.

That's great!

What i would like to do is:
if (EMA(8)[0]> SMA (20)[0] && STU.UpTrend [0]&& KU.Trend [0]> 0 )
{
DrawArrowUp("arrow"+CurrentBar, true, 0, Open[0]-arrowOffset*TickSize, arrowColorUp);
}
But I don't get 1 arrow up (like a signal) I get an arrow every bar as long as the condition holds. That's the reason I'm using colorbars. I'm trying to get 1 arrow/signal when the conditions becomes true for long and 1 arrow/signal when the condition is short.

Thanks.

Difference between discomfort and pain = 1 tick
Reply With Quote
 
  #9 (permalink)
Market Wizard
Houston, TX
 
Futures Experience: Intermediate
Platform: NinjaTrader
Broker/Data: Optimus Futures
Favorite Futures: 6E
 
TheWizard's Avatar
 
Posts: 1,711 since Jun 2009
Thanks: 509 given, 4,072 received


KrazyTrader View Post
That's great!

What i would like to do is:
if (EMA(8)[0]> SMA (20)[0] && STU.UpTrend [0]&& KU.Trend [0]> 0 )
{
DrawArrowUp("arrow"+CurrentBar, true, 0, Open[0]-arrowOffset*TickSize, arrowColorUp);
}
But I don't get 1 arrow up (like a signal) I get an arrow every bar as long as the condition holds. That's the reason I'm using colorbars. I'm trying to get 1 arrow/signal when the conditions becomes true for long and 1 arrow/signal when the condition is short.

Thanks.

@KrazyTrader,

Try adding two bool fields to the Variables section:

private bool uparrowdrawn = false;
private bool downarrowdrawn = false;

Look at it as a "switch" If the light in the room is already on, then don't turn the lightswitch on again. If the light is off, then it's ok to turn the lightswitch on. In your case, your code is telling the indicator to draw the arrow - every time - so long as the condition remains true. You only want to draw it ONCE, so long as the condition remains true - until the condition changes.

Set them both to FALSE in the variables section. We're assuming that both the up and down condition do not exist, to begin with, then add (bolded for emphasis):

if(uparrowdrawn == false) (note the double "=" sign)
{
DrawArrowUp("Up arrow" + CurrentBar, false, 0, Low[0]-arrowoffset*TickSize, arrowColorUp);
uparrowdrawn = true;
downarrowdrawn = false;

}

Each "cycle" thru the code, it will check & see if the (up or down) arrow has already been drawn. If uparrowdrawn / downarrowdrawn is already true, then it won't execute the DrawArrow code again.


and for the down arrow:

if(downarrowdrawn == false) (note the double "=" sign)
{
DrawArrowDown("Down arrow" + CurrentBar, false, 0, High[0]+arrowoffset*TickSize, arrowColorDown);
downarrowdrawn = true;
uparrowdrawn = false;

}

Using the Low[0]-arrowoffset*Ticksize (for the up arrow) and High[0]+arrowoffset*Ticksize (for the down arrow) will displace the drawing of the arrow below the low of the bar, or above the high of the bar, so that the arrow won't be covered by the price bar itself, as it probably would be using Open[0] and Close[0]

Try that & see if it gives you what you want.

p.s. I'm sure there's a more sophisticated way of handling this, but this is the method I've used for years, and it works fine. I'm just a self-trained cut & paste coder myself!

After all, it's what you learn AFTER you know it all, that counts!
Reply With Quote
The following 2 users say Thank You to TheWizard for this post:
 
  #10 (permalink)
Elite Member
Dallas, TX/USA
 
Futures Experience: Intermediate
Platform: NinjaTrader
Favorite Futures: ES, CL
 
Posts: 46 since Aug 2013
Thanks: 52 given, 6 received



TheWizard View Post
@KrazyTrader,

Try adding two bool fields to the Variables section:

private bool uparrowdrawn = false;
private bool downarrowdrawn = false;

Look at it as a "switch" If the light in the room is already on, then don't turn the lightswitch on again. If the light is off, then it's ok to turn the lightswitch on. In your case, your code is telling the indicator to draw the arrow - every time - so long as the condition remains true. You only want to draw it ONCE, so long as the condition remains true - until the condition changes.

Set them both to FALSE in the variables section. We're assuming that both the up and down condition do not exist, to begin with, then add (bolded for emphasis):

if(uparrowdrawn == false) (note the double "=" sign)
{
DrawArrowUp("Up arrow" + CurrentBar, false, 0, Low[0]-arrowoffset*TickSize, arrowColorUp);
uparrowdrawn = true;
downarrowdrawn = false;

}

Each "cycle" thru the code, it will check & see if the (up or down) arrow has already been drawn. If uparrowdrawn / downarrowdrawn is already true, then it won't execute the DrawArrow code again.


and for the down arrow:

if(downarrowdrawn == false) (note the double "=" sign)
{
DrawArrowDown("Down arrow" + CurrentBar, false, 0, High[0]+arrowoffset*TickSize, arrowColorDown);
downarrowdrawn = true;
uparrowdrawn = false;

}

Using the Low[0]-arrowoffset*Ticksize (for the up arrow) and High[0]+arrowoffset*Ticksize (for the down arrow) will displace the drawing of the arrow below the low of the bar, or above the high of the bar, so that the arrow won't be covered by the price bar itself, as it probably would be using Open[0] and Close[0]

Try that & see if it gives you what you want.

p.s. I'm sure there's a more sophisticated way of handling this, but this is the method I've used for years, and it works fine. I'm just a self-trained cut & paste coder myself!

Thanks. I'll check it out and let you know.
p.s. I use the Open [0] -arrowoffset*Ticksize with if(FirstTickOfBar) to determine risk. I wait on a pullback if ArrowUp is above my stop position... enter market if ArrowUp is below my stop position.

Difference between discomfort and pain = 1 tick
Reply With Quote

Reply



futures io > > > > > 1 Signal from 3 Indicators

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
     

Similar Threads
Thread Thread Starter Forum Replies Last Post
Some MT4 Indicators not working (Downloads/Indicators) smarttrades101 MetaTrader 4 November 11th, 2015 03:25 PM
Converting C# Ninjatrader 7 Indicators to C++ Sierra Chart Indicators ? sandptrader Platforms and Indicators 6 November 10th, 2015 03:44 PM
Coding indicators to produce signals for Bloodhound(BH) - Decycle Indicators Cheech Elite Automated NinjaTrader Trading 29 November 7th, 2015 01:28 PM
Installed indicators all end up looking like RSI indicators! Angelo1 NinjaTrader 4 July 15th, 2011 06:10 AM
Market Analyzer Indicators to Summarize Chart Indicators nirajkrishna The Elite Circle 5 March 18th, 2011 08:13 PM


All times are GMT -4. The time now is 01:51 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.17 seconds with 19 queries on phoenix via your IP 54.92.201.232