Scalper Buys/Sell Replica - Page 4 - Traders Laboratory

Go Back   Traders Laboratory > Trading Resources > Trading Indicators

Trading Indicators Post your custom trading indicators. If you download, remember to click INSTALL.


Comment
 
LinkBack (23) Release Tools Display Modes
 
Old 07-27-2007, 10:18 PM
traderlu's Avatar
traderlu traderlu is offline
traderlu has no status.

Trader Specs
 
Join Date: May 2007
Location: Salt Lake City
Posts: 12
Thanks: 0
Thanked 0 Times in 0 Posts
Lightbulb Scalper Buys/Sell Replica

Hi All,

I have been an avid reader of this forum for a while. I just thought I would contribute to an internet that I have taken so much from...

Here is a replica of Scalper Buys and Sells. As far as I can tell, it matches up perfectly. If you would like to use it along with the Heiken-Ashi paintbars, I recommend you set the plot thickness to at least two more than the thickness of the Heiken-Ashi (In the attached picture, the Scalper Indicator is set to 3 and the...

Reply With Quote
  #30 (permalink)  
By HAL9000 on 02-21-2008, 06:16 PM
Re: Scalper Buys/Sell Replica

Quote:
View Post
When I use the scalper buy/sell indicator, ever so often I seem to get an incorrect signal. I have seen this on many different time frames. I'm attaching two images that highlightthe problem.
Hello Shawn,

as far as I understand this indicator (the original and this replica), I think that everything is OK.
Just that you know, I don't own a license regarding the original and I don't use this replica.

OK, but let me try to explain:
In your first example, a red (sell) bar is plotted after some time (pivot bar).
To do this, you need a trigger bar just behind it.
A trigger bar is a bar with no new high behind a potential sell pivot bar. Now we need a close on a following bar lower than the low of the trigger bar without a new high, to mark the potential pivot bar as such.

Hopefully this is understandable. Otherwise, try to explain your example two, and we can discuss it here.


Cheers,

Hal
Reply With Quote
  #31 (permalink)  
By traderandreas on 02-21-2008, 10:28 PM
Re: Scalper Buys/Sell Replica

Hi,
Could some one please provide the indicator for ninja trader.
thanks,
Andreas
Reply With Quote
  #32 (permalink)  
By thrunner on 02-21-2008, 11:02 PM
Re: Scalper Buys/Sell Replica

Quote:
View Post
Hi,Could some one please provide the indicator for ninja trader.thanks,Andreas
The Scapler is actually part of the indicator package in the latest NT so currently you don't need to import it. It was originally ported/coded by Gumphrie, but there is no guarantee that NT won't remove it from NT once TTM starts marketing their TTM suite for NT. So here it is the attached and code listed :
// 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); }
Attached Files
File Type: zip Scalper0.5.zip (3.7 KB, 114 views)
Reply With Quote
  #33 (permalink)  
By traderandreas on 02-21-2008, 11:26 PM
Re: Scalper Buys/Sell Replica

Hi Thrunner,
Thankyou for your quick reply it is greatly appreciated.
regards,
Andreas
Reply With Quote
  #34 (permalink)  
By ShawnZoom on 02-22-2008, 01:09 AM
Re: Scalper Buys/Sell Replica

Quote:
View Post
Hello Shawn,

as far as I understand this indicator (the original and this replica), I think that everything is OK.
Just that you know, I don't own a license regarding the original and I don't use this replica.

OK, but let me try to explain:
In your first example, a red (sell) bar is plotted after some time (pivot bar).
To do this, you need a trigger bar just behind it.
A trigger bar is a bar with no new high behind a potential sell pivot bar. Now we need a close on a following bar lower than the low of the trigger bar without a new high, to mark the potential pivot bar as such.

Hopefully this is understandable. Otherwise, try to explain your example two, and we can discuss it here.


Cheers,

Hal
Thanks for your reply Hal. I now have a better understanding of how this indicator works
Reply With Quote
  #35 (permalink)  
By janlani on 03-06-2008, 06:41 PM
Re: Scalper Buys/Sell Replica

Has anyone found something similar to the TTM Confirmation indicator that they sell as part of their 5 indicator package. The link that shows it is --> http://www.tradethemarkets.com/products/item7.cfm

It would be cool to test out if someone has something similar where all three (macd, rsi, & stochastics).
Reply With Quote
  #36 (permalink)  
By strtedat22 on 04-04-2008, 11:16 PM
Re: Scalper Buys/Sell Replica

Ive been wanting to use this indicator for the longest. Does anyone have the language in Open E Cry?

thanks,
Eugene Mclaurin
Reply With Quote
  #37 (permalink)  
By strtedat22 on 04-04-2008, 11:41 PM
Re: Scalper Buys/Sell Replica

Quote:
View Post
Ive been wanting to use this indicator for the longest. Does anyone have the language in Open E Cry?

thanks,
Eugene Mclaurin
BTW: OEC uses C# language...is that going to be a problem?
Reply With Quote
  #38 (permalink)  
By silverwesoke on 04-28-2008, 06:57 PM
Re: Scalper Buys/Sell Replica

Hi Luis..Thanks for the indicator..I noticed today using it that it did not pick up a couple of signals on a 60 min chart. By the definition you offered, with a higher low of last two bars, then a lower low, then a break of that bars low..and it didnt paint.. Have you ever noticed it miss some occurances?? Thanks for any feedback.. CG
Reply With Quote
  #39 (permalink)  
By silverwesoke on 04-28-2008, 06:58 PM
Re: Scalper Buys/Sell Replica

Oops, I meant to type a higher hi of last two bars, then a lower high, the a break of that bars low... thats how you defined it in the thread I saw. Thx
Reply With Quote
Comment



LinkBacks (?)
LinkBack to this Thread: http://www.traderslaboratory.com/forums/f46/scalper-buys-sell-replica-2124.html
Posted By For Type Date
kreslik.com - Traders Community :: View topic - TTM Scalper? Aka, 3 Higher Lows/Highs This thread Refback 01-07-2008 07:57 AM
kreslik.com - Traders Community :: View topic - TTM Scalper? Aka, 3 Higher Lows/Highs This thread Refback 12-23-2007 01:22 PM
TTM Squeeze and Medved Quotetracker… » Poker - Daytrading - Handicapping - Boogster’s Blog This thread Refback 09-18-2007 09:08 AM
kreslik.com - Traders Community :: View topic - TTM Scalper? Aka, 3 Higher Lows/Highs This thread Refback 09-12-2007 07:58 PM
kreslik.com - Traders Community :: View topic - TTM Scalper? Aka, 3 Higher Lows/Highs This thread Refback 09-09-2007 09:17 PM
kreslik.com - Traders Community :: View topic - TTM Scalper? Aka, 3 Higher Lows/Highs This thread Refback 08-29-2007 07:05 PM
TTM Squeeze and Medved Quotetracker… » Poker - Daytrading - Handicapping - Boogster’s Blog This thread Refback 08-24-2007 11:29 AM
room606's bookmarks tagged with This thread Refback 08-13-2007 01:10 PM
EXPERT - MQL4 фþруü This thread Refback 08-11-2007 11:28 AM
kreslik.com - Traders Community :: View topic - TTM Scalper? Aka, 3 Higher Lows/Highs This thread Refback 08-07-2007 06:28 PM
Trading Indicators [Archive] - Traders Laboratory This thread Refback 08-06-2007 01:53 PM
kak ego??? zostavit robotat - MQL4 фþруü This thread Refback 08-06-2007 12:07 PM
kreslik.com - Traders Community :: View topic - TTM Scalper? Aka, 3 Higher Lows/Highs This thread Refback 07-31-2007 09:35 AM
kreslik.com - Traders Community :: View topic - TTM Scalper? Aka, 3 Higher Lows/Highs This thread Refback 07-31-2007 06:52 AM
kreslik.com - Traders Community :: View topic - TTM Scalper? Aka, 3 Higher Lows/Highs This thread Refback 07-30-2007 10:31 PM
kreslik.com - Traders Community :: View topic - TTM Scalper? Aka, 3 Higher Lows/Highs This thread Refback 07-30-2007 06:26 PM
kreslik.com - Traders Community :: View topic - TTM Scalper? Aka, 3 Higher Lows/Highs This thread Refback 07-30-2007 11:40 AM
kreslik.com - Traders Community :: View topic - TTM Scalper? Aka, 3 Higher Lows/Highs This thread Refback 07-29-2007 05:42 AM
kreslik.com - Traders Community :: View topic - TTM Scalper? Aka, 3 Higher Lows/Highs This thread Refback 07-29-2007 04:22 AM
kreslik.com - Traders Community :: View topic - TTM Scalper? Aka, 3 Higher Lows/Highs This thread Refback 07-29-2007 12:45 AM
kreslik.com - Traders Community :: View topic - TTM Scalper? Aka, 3 Higher Lows/Highs This thread Refback 07-28-2007 11:50 PM
kreslik.com - Traders Community :: View topic - TTM Scalper? Aka, 3 Higher Lows/Highs This thread Refback 07-28-2007 11:37 PM
Traders Laboratory - forumdisplay This thread Refback 07-28-2007 12:31 AM

Currently Active Users Viewing This Release: 1 (0 members and 1 guests)
 
Release Tools