Go Back   Traders Laboratory > General Topics > Beginners Forum

Frequent Questions

Beginners Forum Interested in trading but don't know where to start? Post any questions you may have here.

Reply
Bookmarks
del.icio.us StumbleUpon Google Digg Facebook Furl Reddit Netscape

 
LinkBack (1) Thread Tools Search this Thread Display Modes Language
  1 links from elsewhere to this Post. Click to view. #1 (permalink)  
Old 01-12-2008, 11:22 AM
jphillips9 jphillips9 is offline
Registered Trader

 
Join Date: Jan 2008
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Does Anyone have the TTM Scalper Code for Esignal???

I've looked on this forum and others and I can only find the TTM Scalper code for Tradestation. Anyone know where I can get the code for Esignal?

Thanks

Reply With Quote
  #2 (permalink)  
Old 01-14-2008, 04:33 PM
thrunner thrunner is offline
Registered Trader

 
Join Date: Feb 2007
Posts: 155
Thanks: 50
Thanked 34 Times in 17 Posts
Re: Does Anyone have the TTM Scalper Code for Esignal???

Welcome to the forum. This indicator looks better than it actually is.
It actually plots the scalper bar usually about 3 bars later, retrospectively. That makes it hard to use in any strategy (and hard to program if your platform doesn't support such plotting).

Here is the C# code from NT. Perhaps you can adapt it for Esignal.
http://www.ninjatrader-support.com/v...hlight=scalper
// Scalper v0.1 by Gumphrie, inspired by John Carter's TTMScalper // v0.2 - removed the period parameter as pretty much useless and changed all the high/low calaculations to be one bar ahead // v0.3 - fixed possible plotting error // v0.4 - additional check for highest and lowest // v0.5 - reduced cpu usage & added trigger bar alert arrows #region Using declarations using System; using System.Diagnostics; using System.Drawing; using System.Drawing.Drawing2D; using System.ComponentModel; using System.Xml.Serialization; using System.Text; using NinjaTrader.Cbi; using NinjaTrader.Data; using NinjaTrader.Gui.Chart; using NinjaTrader.Gui.Design; #endregion // This namespace holds all indicators and is required. Do not change it. namespace NinjaTrader.Indicator { /// <summary> /// Scalper /// </summary> [Description("Scalper")] [Gui.Design.DisplayName("Scalper")] public class Scalper : Indicator { #region Variables private SolidBrush ScalpBarBrush = new SolidBrush(Color.Lavender); private int counter = 0; private int ExtremeBar = 0; private int lastBar=0; private bool HighPainted = false; private bool LowPainted = true; private bool showTriggers = false; private double ExtremeBarHigh = 0; private double TriggerBarLow = 0; private double ExtremeBarLow = 0; private double TriggerBarHigh = 0; private int TriggerBarLowNo=0; private int TriggerBarHighNo=0; private DataSeries scalpSeries; private DataSeries open; private DataSeries high; private DataSeries low; private DataSeries close; #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() { Overlay = true; scalpSeries = new DataSeries(this); open = new DataSeries(this); high = new DataSeries(this); low = new DataSeries(this); close = new DataSeries(this); CalculateOnBarClose = true; } /// <summary> /// Called on each bar update event (incoming tick) /// </summary> protected override void OnBarUpdate() { open.Set(Open[0]); high.Set(High[0]); low.Set(Low[0]); close.Set(Close[0]); if (CurrentBar <= 4) { scalpSeries.Set(0); } else { //Up if (HighPainted==false) { if ((High[1] < High[2]) && (0==ExtremeBar)) //if ((High[1] < High[2]) && (2 == Bars.HighestBar(3)) && (0==ExtremeBar)) { ExtremeBar = 2; ExtremeBarHigh = High[2]; TriggerBarLow = Low[1]; TriggerBarLowNo = CurrentBar-1; // if (ExtremeBarLow > High[4]) ExtremeBar = 4; } if (High[0] > ExtremeBarHigh) { ExtremeBar = 0; ExtremeBarHigh = 0; TriggerBarLow = 0; TriggerBarLowNo = 0; counter=-1; } if (0!=ExtremeBar) counter++; if ((Close[0] < TriggerBarLow) && (0!=ExtremeBar)) { ExtremeBar = ExtremeBar + counter; HighPainted = true; counter=-1; scalpSeries.Set(CurrentBar-ExtremeBar); ExtremeBar=0; } } //Down if (HighPainted==true) { if ((Low[1] > Low[2]) && (0==ExtremeBar)) //if ((Low[1] > Low[2]) && (2 == Bars.LowestBar(3)) && (0==ExtremeBar)) { ExtremeBar = 2; ExtremeBarLow = Low[2]; TriggerBarHigh = High[1]; TriggerBarHighNo = CurrentBar-1; // if (ExtremeBarLow > Low[4]) ExtremeBar = 4; } if (Low[0] < ExtremeBarLow) { ExtremeBar = 0; ExtremeBarLow = 0; TriggerBarHigh = 0; TriggerBarHighNo = 0; counter=-1; } if (0!=ExtremeBar) counter++; if ((Close[0] > TriggerBarHigh) && (0!=ExtremeBar)) { ExtremeBar = ExtremeBar + counter; HighPainted = false; counter=-1; scalpSeries.Set(CurrentBar-ExtremeBar); ExtremeBar=0; } } // else scalpSeries.Set(0); } lastBar=CurrentBar; } public override void Plot(Graphics graphics, Rectangle bounds, double min, double max) { // Default plotting in base class. //base.Plot(graphics, bounds, min, max); if (base.Bars == null) return; if (ChartControl.ChartStyleType.ToString()=="LineOnClose") return; int index = -1; Exception caughtException; int barPaintWidth = ChartControl.ChartStyle.GetBarPaintWidth(ChartControl.BarWidth); int bars = ChartControl.BarsPainted; while (bars >= 0) { index = ((ChartControl.LastBarPainted - ChartControl.BarsPainted) + 1) + bars; if (ChartControl.ShowBarsRequired || ((index - Displacement) >= BarsRequired)) { try { bool ScalpBar=false; for (int scalpBar=index;scalpBar<=lastBar;scalpBar++) { if (scalpSeries.Get(scalpBar)==index) { ScalpBar=true; break; } } if (ScalpBar) { int x1 = (((ChartControl.CanvasRight - ChartControl.BarMarginRight) - (barPaintWidth / 2)) - ((ChartControl.BarsPainted - 1) * ChartControl.BarSpace)) + (bars * ChartControl.BarSpace); int y1 = (bounds.Y + bounds.Height) - ((int) (((high.Get(index) - min) / ChartControl.MaxMinusMin(max, min)) * bounds.Height)); int y2 = (bounds.Y + bounds.Height) - ((int) (((close.Get(index) - min) / ChartControl.MaxMinusMin(max, min)) * bounds.Height)); int y3 = (bounds.Y + bounds.Height) - ((int) (((open.Get(index) - min) / ChartControl.MaxMinusMin(max, min)) * bounds.Height)); int y4 = (bounds.Y + bounds.Height) - ((int) (((low.Get(index) - min) / ChartControl.MaxMinusMin(max, min)) * bounds.Height)); if (ChartControl.ChartStyleType.ToString()=="OHLC") graphics.DrawLine(new Pen(ScalpBarBrush.Color,(int)((((double)ChartControl.BarWidth)/3)*2)),x1,y1,x1,y4); else if (ChartControl.ChartStyleType.ToString()=="HiLoBars") graphics.DrawLine(new Pen(ScalpBarBrush.Color,ChartControl.BarWidth),x1,y1,x1,y4); else { byte bRed = (byte)~(ChartControl.BackColor.R); byte bGreen = (byte)~(ChartControl.BackColor.G); byte bBlue = (byte)~(ChartControl.BackColor.B); Pen pen = new Pen(Color.FromArgb(bRed,bGreen,bBlue), 1); graphics.FillRectangle(ScalpBarBrush,x1-(barPaintWidth/2)+1,y1,barPaintWidth-2,y4-y1); if (y2>y3) { graphics.DrawLine(pen,x1,y1,x1,y3); graphics.DrawLine(pen,x1,y2,x1,y4); } else { graphics.DrawLine(pen,x1,y1,x1,y2); graphics.DrawLine(pen,x1,y3,x1,y4); } graphics.DrawLine(pen,x1-(barPaintWidth/2)+1,y3,x1+(barPaintWidth/2)-2,y3); graphics.DrawLine(pen,x1-(barPaintWidth/2),y2,x1+(barPaintWidth/2),y2); graphics.DrawLine(pen,x1-(barPaintWidth/2),y2,x1-(barPaintWidth/2),y3); graphics.DrawLine(pen,x1+(barPaintWidth/2),y2,x1+(barPaintWidth/2),y3); } } else if (showTriggers) { if ((TriggerBarLowNo>0) && (TriggerBarLowNo==index)) { int x1 = (((ChartControl.CanvasRight - ChartControl.BarMarginRight) - (barPaintWidth / 2)) - ((ChartControl.BarsPainted - 1) * ChartControl.BarSpace)) + (bars * ChartControl.BarSpace); int y1 = (bounds.Y + bounds.Height) - ((int) ((((high.Get(index)+(2*TickSize)) - min) / ChartControl.MaxMinusMin(max, min)) * bounds.Height)); DrawArrow((barPaintWidth/5)*4, graphics,x1,y1,ScalpBarBrush,false); } if ((TriggerBarHighNo>0) && (TriggerBarHighNo==index)) { int x1 = (((ChartControl.CanvasRight - ChartControl.BarMarginRight) - (barPaintWidth / 2)) - ((ChartControl.BarsPainted - 1) * ChartControl.BarSpace)) + (bars * ChartControl.BarSpace); int y1 = (bounds.Y + bounds.Height) - ((int) ((((low.Get(index)-(2*TickSize)) - min) / ChartControl.MaxMinusMin(max, min)) * bounds.Height)); DrawArrow((barPaintWidth/5)*4, graphics,x1,y1,ScalpBarBrush,true); } } } catch (Exception exception) { caughtException = exception; } } bars--; } } private void DrawArrow(int arrowSize, Graphics graphics, int x, int y, SolidBrush brush, bool up) { Point[] points; int halfSize = (int) Math.Floor((double) (((double) arrowSize) / 2)); Point[] upPoints = new Point[] { new Point(0, 0), new Point(arrowSize, arrowSize), new Point(halfSize, arrowSize), new Point(halfSize, arrowSize * 2), new Point(-halfSize, arrowSize * 2), new Point(-halfSize, arrowSize), new Point(-arrowSize, arrowSize), new Point(0, 0) }; //Point[] dnPoints = new Point[] { new Point(-halfSize, -arrowSize * 2), new Point(halfSize, -arrowSize * 2), new Point(halfSize, -arrowSize), new Point(arrowSize, -arrowSize), new Point(0, 0), new Point(-arrowSize, -arrowSize), new Point(-halfSize, -arrowSize), new Point(-halfSize, -arrowSize * 2) }; //Point[] upPoints = new Point[] { new Point(0, -arrowSize), new Point(arrowSize, arrowSize), new Point(0, arrowSize/2), new Point(-arrowSize, arrowSize), new Point(0, -arrowSize) }; Point[] dnPoints = new Point[] { new Point(-halfSize, -arrowSize * 2), new Point(halfSize, -arrowSize * 2), new Point(halfSize, -arrowSize), new Point(arrowSize, -arrowSize), new Point(0, 0), new Point(-arrowSize, -arrowSize), new Point(-halfSize, -arrowSize), new Point(-halfSize, -arrowSize * 2) }; if (up) { points = upPoints; } else { points = dnPoints; } for (int i = 0; i < points.Length; i++) { points[i].Offset(x, y); } byte bRed = (byte)~(base.ChartControl.BackColor.R); byte bGreen = (byte)~(base.ChartControl.BackColor.G); byte bBlue = (byte)~(base.ChartControl.BackColor.B); graphics.FillPolygon(brush, points); graphics.DrawPolygon(new Pen(Color.FromArgb(bRed,bGreen,bBlue)), points); } #region Properties /// <summary> /// </summary> [Browsable(false)] public string ScalpBarColorSerialize { get { return SerializableColor.ToString(this.ScalpBarColor); } set { this.ScalpBarColor = SerializableColor.FromString(value); } } [Description("Default Colour for Scalp Bar"), XmlIgnore, VisualizationOnly] [Category("Scalp Bar")] [NinjaTrader.Gui.Design.DisplayName("Scalp bar color")] public Color ScalpBarColor { get { return this.ScalpBarBrush.Color; } set { this.ScalpBarBrush = new SolidBrush(value); } } [Description("Highlights the current trigger bars by displaying an arrow above or below them.")] [Category("Scalp Bar")] [NinjaTrader.Gui.Design.DisplayName("Highlight current trigger bars")] public bool ScalperTriggers { get { return showTriggers; } set { showTriggers = value; } } #endregion } } #region NinjaScript generated code. Neither change nor remove. // This namespace holds all indicators and is required. Do not change it. namespace NinjaTrader.Indicator { public partial class Indicator : IndicatorBase { private Scalper[] cacheScalper = null; private static Scalper checkScalper = new Scalper(); /// <summary> /// Scalper /// </summary> /// <returns></returns> public Scalper Scalper() { return Scalper(Input); } /// <summary> /// Scalper /// </summary> /// <returns></returns> public Scalper Scalper(Data.IDataSeries input) { if (cacheScalper != null) for (int idx = 0; idx < cacheScalper.Length; idx++) if (cacheScalper[idx].EqualsInput(input)) return cacheScalper[idx]; Scalper indicator = new Scalper(); indicator.SetUp(); indicator.CalculateOnBarClose = CalculateOnBarClose; indicator.Input = input; Scalper[] tmp = new Scalper[cacheScalper == null ? 1 : cacheScalper.Length + 1]; if (cacheScalper != null) cacheScalper.CopyTo(tmp, 0); tmp[tmp.Length - 1] = indicator; cacheScalper = tmp; Indicators.Add(indicator); return indicator; } } } // This namespace holds all market analyzer column definitions and is required. Do not change it. namespace NinjaTrader.MarketAnalyzer { public partial class Column : ColumnBase { /// <summary> /// Scalper /// </summary> /// <returns></returns> [Gui.Design.WizardCondition("Indicator")] public Indicator.Scalper Scalper() { return _indicator.Scalper(Input); } /// <summary> /// Scalper /// </summary> /// <returns></returns> public Indicator.Scalper Scalper(Data.IDataSeries input) { return _indicator.Scalper(input); } } } // This namespace holds all strategies and is required. Do not change it. namespace NinjaTrader.Strategy { public partial class Strategy : StrategyBase { /// <summary> /// Scalper /// </summary> /// <returns></returns> [Gui.Design.WizardCondition("Indicator")] public Indicator.Scalper Scalper() { return _indicator.Scalper(Input); } /// <summary> /// Scalper /// </summary> /// <returns></returns> public Indicator.Scalper Scalper(Data.IDataSeries input) { if (InInitialize && input == null) throw new ArgumentException("You only can access an indicator with the default input/bar series from within the 'Initialize()' method"); return _indicator.Scalper(input); } } } #endregion

Reply With Quote
  #3 (permalink)  
Old 01-14-2008, 07:08 PM
carcanaques carcanaques is offline
Registered Trader

 
Join Date: Oct 2007
Posts: 45
Thanks: 0
Thanked 0 Times in 0 Posts
Re: Does Anyone have the TTM Scalper Code for Esignal???

All of TTM TradeStation plug-ins suck. It's amazing that anyone would pay anything for them, but John Carter is the consumate salesman in the futures business.

Reply With Quote
  #4 (permalink)  
Old 01-14-2008, 07:18 PM
jphillips9 jphillips9 is offline
Registered Trader

 
Join Date: Jan 2008
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Re: Does Anyone have the TTM Scalper Code for Esignal???

Thanks Thrunner - I'll give it a shot

Reply With Quote
  #5 (permalink)  
Old 01-14-2008, 07:21 PM
Sparrow's Avatar
Sparrow Sparrow is offline
Nit

Trader Specs
 
Join Date: May 2007
Location: Vienna/Austria
Posts: 316
Thanks: 89
Thanked 17 Times in 14 Posts
Re: Does Anyone have the TTM Scalper Code for Esignal???

I fully agree with carcanaques. TTM's indicators are way overpriced for something so simple. I can't believe that the scalper would provide any edge at all. It required 3 bars before showing anything and during a consolidation that means getting chopped up. TRO posted his versions of the TTM indicators, wouldn't know where they have gone though.
Here's TheRumpledOne's opinion btw.

Reply With Quote
  #6 (permalink)  
Old 01-14-2008, 07:26 PM
jphillips9 jphillips9 is offline
Registered Trader

 
Join Date: Jan 2008
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Re: Does Anyone have the TTM Scalper Code for Esignal???

Sparrow,

Thanks for your input (you too Carcanaques). Was just wanting to paper trade the TTM indicators to see if they were any better than my current setups.

Reply With Quote
Reply

LinkBacks (?)
LinkBack to this Thread: http://www.traderslaboratory.com/forums/f30/does-anyone-have-the-ttm-scalper-3200.html
Posted By For Type Date
Traders Laboratory This thread Refback 01-12-2008 09:12 PM


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
TradeStation Strategy Code Help jjthetrader Coding Forum 0 11-02-2007 05:39 PM
TTM trend esignal code philloo Trading Indicators 0 10-17-2007 09:17 AM
Floor Trader Pivot Code Help.... jmi88 Coding Forum 1 05-22-2007 10:13 PM
hey hey any scalper here hanz Introduce Yourself 3 03-23-2007 11:35 AM


All times are GMT -4. The time now is 11:38 PM.

 


1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59