According to your posted code and screenshot they are not the same
Announcement
Collapse
No announcement yet.
Partner 728x90
Collapse
NinjaTrader
Super Trend For Ninja Trader Needed
Collapse
X
-
-
Candle bars full colour
Firstly many thanks for this Super Trend.
As I'm still hopeless at programming such things, it's great help to have such contributions.
Using the "Colour Bar" option, for say an up bar that has a close higher than its' open, the body of the candle is not coloured, just it's outline is coloured.
May I ask if it's possible, when using "colour bar" option, to have the body of the candle bar to be fully coloured, regrdless of where the bar close is in relation to it's open. ?
Also, when "Calculate on bar close" is set to "False", the bars colour incorrectly.
Can this be corrected ?
Many thxLast edited by dj22522; 06-03-2009, 07:23 PM.
Comment
-
Originally posted by dj22522 View PostFirstly many thanks for this Super Trend.
As I'm still hopeless at programming such things, it's great help to have such contributions.
Using the "Colour Bar" option, for say an up bar that has a close higher than its' open, the body of the candle is not coloured, just it's outline is coloured.
May I ask if it's possible, when using "colour bar" option, to have the body of the candle bar to be fully coloured, regrdless of where the bar close is in relation to it's open. ?
Also, when "Calculate on bar close" is set to "False", the bars colour incorrectly.
Can this be corrected ?
Many thx
With parameters - no.
With code change - yes.
Feel free to play with code and modify it.
Comment
-
Originally posted by velocity View PostI created a data series "bsSignal" to add a +1 when you're in an Uptrend and -1 when you're in a Downtrend. So now all you need to do is code your Strategy using +1 / -1 as a condition in the Strategy Wizard. No need for programing!!
Good Luck
Thank you
Comment
-
Just FYI,
Aparently Roonius built his latest version (TSSuperTrend 2.1,post 217, with improved speed/efficiency) not on the version before that by EW (SuperTrend2.1, post 210).
Therefore the 4th Algo Fixed Percent and the Zerolags disappeared from the last version.
I did not look yet in the code what Velocity used as base.
BTW If you renew the TSSuperTrend.cs don't forget to also renew (allow overscribing when importing the ZIP) to the correct version of TradingStudies.NinjaScript.Utility.csLast edited by WhoKnows; 06-05-2009, 05:41 AM.
Comment
-
this will work, long and short.
#region Using declarations
using System;
using System.ComponentModel;
using System.Diagnostics;
using System.Drawing;
using System.Drawing.Drawing2D;
using System.Xml.Serialization;
using NinjaTrader.Cbi;
using NinjaTrader.Data;
using NinjaTrader.Indicator;
using NinjaTrader.Gui.Chart;
using NinjaTrader.Strategy;
#endregion
// This namespace holds all strategies and is required. Do not change it.
namespace NinjaTrader.Strategy
{
/// <summary>
/// Enter the description of your strategy here
/// </summary>
[Description("Enter the description of your strategy here")]
public class testSuperTrend : Strategy
{
#region Variables
#endregion
/// <summary>
/// This method is used to configure the strategy and is called once before any strategy method is called.
/// </summary>
protected override void Initialize()
{
CalculateOnBarClose = true;
Add(DynamicSR(21));
Add(SuperTrend(10, 3));
Add(CCI_Histogram(14)) ;
Add(ElliotOscillator(5, 35));
}
/// <summary>
/// Called on each bar update event (incoming tick)
/// </summary>
protected override void OnBarUpdate()
{
//go long
if
(Close[0] > DynamicSR(21).Resistance[0] && Close[0] > SuperTrend(10, 3).UpTrend[0]
&& CCI_Histogram(14).CCIoversold[0] > 0 && ElliotOscillator(5, 34).Uptrend[0] > 0)
{
EnterLong(DefaultQuantity, "");
}
//stop if closes under dynamic S
if (Position.MarketPosition == MarketPosition.Long && Close[0] < DynamicSR(21).Support[0])
{ ExitLong();
}
//go short if everything indicated short
if (Close[0] < DynamicSR(21).Support[0] && Close[0] < SuperTrend(10, 3).DownTrend[0]
&& CCI_Histogram(14).CCIoversold[0] < 0 && ElliotOscillator(5, 34).Uptrend[0] < 0)
{
EnterShort();
}
//cover short if close above dynamic R
if (Position.MarketPosition == MarketPosition.Short && Close[0] > DynamicSR(21).Resistance[0])
{
ExitShort();
}
}
#region Properties
#endregion
}
}Last edited by tortexal; 06-07-2009, 11:03 PM.
Comment
-
Originally posted by velocity View PostI created a data series "bsSignal" to add a +1 when you're in an Uptrend and -1 when you're in a Downtrend. So now all you need to do is code your Strategy using +1 / -1 as a condition in the Strategy Wizard. No need for programing!!
Good Luck
After this file is in its place, just use this bsSignal as parameter in strategy wizard with other conditions?
Comment
-
After I put in the folder, where do I see the "bsSignal" parameter in Strategy Wizard?
I checked TSSuperTrend Indicator, I dont see "bsSignal"
I just checked out the whole thread, there are more than 1 version of TSSuperTrend. Im using the first attachment at the beginning of the thread. Could it be the issue?
I also downloaded both SuperTrend and TSSuperTrend. And the TSSuperTrend.cs file and replaced the original one from TSSuperTrend, no luck finding "bsSignal" in Strategy Wizard under either SuperTrend nor TSSuperTrend.
Comment
-
Originally posted by tortexal View Postthis will work, long and short.
#region Using declarations
using System;
using System.ComponentModel;
using System.Diagnostics;
using System.Drawing;
using System.Drawing.Drawing2D;
using System.Xml.Serialization;
using NinjaTrader.Cbi;
using NinjaTrader.Data;
using NinjaTrader.Indicator;
using NinjaTrader.Gui.Chart;
using NinjaTrader.Strategy;
#endregion
// This namespace holds all strategies and is required. Do not change it.
namespace NinjaTrader.Strategy
{
/// <summary>
/// Enter the description of your strategy here
/// </summary>
[Description("Enter the description of your strategy here")]
public class testSuperTrend : Strategy
{
#region Variables
#endregion
/// <summary>
/// This method is used to configure the strategy and is called once before any strategy method is called.
/// </summary>
protected override void Initialize()
{
CalculateOnBarClose = true;
Add(DynamicSR(21));
Add(SuperTrend(10, 3));
Add(CCI_Histogram(14)) ;
Add(ElliotOscillator(5, 35));
}
/// <summary>
/// Called on each bar update event (incoming tick)
/// </summary>
protected override void OnBarUpdate()
{
//go long
if
(Close[0] > DynamicSR(21).Resistance[0] && Close[0] > SuperTrend(10, 3).UpTrend[0]
&& CCI_Histogram(14).CCIoversold[0] > 0 && ElliotOscillator(5, 34).Uptrend[0] > 0)
{
EnterLong(DefaultQuantity, "");
}
//stop if closes under dynamic S
if (Position.MarketPosition == MarketPosition.Long && Close[0] < DynamicSR(21).Support[0])
{ ExitLong();
}
//go short if everything indicated short
if (Close[0] < DynamicSR(21).Support[0] && Close[0] < SuperTrend(10, 3).DownTrend[0]
&& CCI_Histogram(14).CCIoversold[0] < 0 && ElliotOscillator(5, 34).Uptrend[0] < 0)
{
EnterShort();
}
//cover short if close above dynamic R
if (Position.MarketPosition == MarketPosition.Short && Close[0] > DynamicSR(21).Resistance[0])
{
ExitShort();
}
}
#region Properties
#endregion
}
}
Is there a "latest" or "common" version of the indicator in use or has this been developed down to paths? What version did you write that strategy for, tortextal?
Getting more familiar with the NinjaScript interface today... a good thing but frustrating for my neophyte self
Comment
Latest Posts
Collapse
Topics | Statistics | Last Post | ||
---|---|---|---|---|
Started by PhillT, 04-19-2024, 02:16 PM
|
3 responses
15 views
0 likes
|
Last Post
by mangel2000
Today, 03:04 AM
|
||
Started by TraderBCL, Today, 02:37 AM
|
0 responses
1 view
0 likes
|
Last Post
by TraderBCL
Today, 02:37 AM
|
||
Started by mangel2000, Today, 02:23 AM
|
0 responses
7 views
0 likes
|
Last Post
by mangel2000
Today, 02:23 AM
|
||
Started by mangel2000, Today, 01:30 AM
|
0 responses
14 views
0 likes
|
Last Post
by mangel2000
Today, 01:30 AM
|
||
Started by Doxxxx, Today, 01:24 AM
|
0 responses
7 views
0 likes
|
Last Post
by Doxxxx
Today, 01:24 AM
|
Comment