Welcome to the Traders Laboratory Forums.
Coding Forum Collaborate, receive help, or discuss coding related issues.

Reply
Old 06-04-2009, 10:20 PM   #1

simterann22's Avatar

Join Date: May 2009
Location: Sydney
Posts: 64
Ignore this user

Thanks: 42
Thanked 51 Times in 20 Posts



Painting 'trigger' Bar Color to Scalper Alert

Hi guys.....

can someone please help me....I've been racking my brains for hours

I don't like to ask unless I've tried myself though... so here it is:

I like to use the Scalper Alert but would like to see the trigger bar painted to get an early warning of the swing high bar being painted....similar to PBFs yellow trigger bars.

Code:
{Scalper Buys and Sells		7/18/2007
	Written by Luis Gomez 
	inspired by John Carters "Mastering the Trade"
}

inputs:
	buyColor(white),
	sellColor(white),
	width(1);
variables:
	highBarsAgo(1),
	possibleHighBarsAgo(1),
	possibleHigh(-2),
	hightoBeat(-1),
	barsSincePaint(1),
	lowBarsAgo(1),
	possibleLowBarsAgo(1),
	possibleLow(10000001),
	lowtoBeat(10000000),
	triggerPriceSell(-1),
	triggerPriceBuy(1000000),
	trend(1),
	_UP(1),
	_DOWN(-1),
	_ON(1),
	_OFF(-1);


//***************************************************
//****** Find and plot the highest swing high *******
//***************************************************

if trend = _UP then begin
	if swingHighBar(1,H,2,barsSincePaint+2) > -1 then begin
		possibleHighBarsAgo = swingHighBar(1,H,2,barsSincePaint+2);
		possibleHigh = H[possibleHighBarsAgo];
	end;

	if possibleHigh >= hightoBeat then begin
		highBarsAgo = possibleHighBarsAgo;
		hightoBeat = possibleHigh;
		triggerPriceSell = L[HighBarsAgo - 1];
	end;
	
	if C < triggerPriceSell and 
		highest(high,highBarsAgo) < hightoBeat then begin
		plotpb[highBarsAgo](H[highBarsAgo],L[highBarsAgo],"",sellColor);
		alert("Scalper Sell");
		trend = _DOWN;
		barsSincePaint = highBarsAgo-1;
		hightoBeat = -1;
		lowtoBeat = 10000000;
		triggerPriceBuy = 10000000;
		triggerPriceSell = -1;
		highBarsAgo = 1;
		possibleHigh = -2;
	end;

end;

//***************************************************
//****** Find and plot the lowest swing low *********
//***************************************************

if trend = _DOWN then begin
	if swingLowBar(1,L,2,barsSincePaint+2) > -1 then begin
		possibleLowBarsAgo = swingLowBar(1,L,2,barsSincePaint+2);
		possibleLow = L[possibleLowBarsAgo];
	end;

	if possibleLow <= lowtoBeat then begin
		lowBarsAgo = possibleLowBarsAgo;
		lowtoBeat = possibleLow;
		triggerPriceBuy = H[LowBarsAgo - 1];
	end;
	
	if C > triggerPriceBuy and 
	lowest(L,lowBarsAgo) > lowtoBeat then begin
		plotpb[lowBarsAgo](H[lowBarsAgo],L[lowBarsAgo],"",buyColor);
		alert("Scalper Buy");
		trend = _UP;
		barsSincePaint = lowBarsAgo-1;
		possibleLow = 10000001;
		lowtoBeat = 10000000;
		hightoBeat = -1;
		triggerPriceBuy = 10000000;
		triggerPriceSell = -1;
		lowBarsAgo = 1;
	end;		

end;

barsSincePaint = barsSincePaint+1;
if trend = _UP then highBarsAgo = highBarsAgo + 1;
if trend = _DOWN then lowBarsAgo = lowBarsAgo + 1;
setPlotWidth(1,width);
Thanks a lot.
simterann22 is offline  
Reply With Quote
Old 06-04-2009, 10:36 PM   #2

Tams's Avatar

Join Date: Sep 2008
Location: Geelong
Posts: 3,590
Ignore this user

Thanks: 2,027
Thanked 1,402 Times in 862 Posts



Re: Painting 'trigger' Bar Color to Scalper Alert

if you post a chart... with arrows and notes on what and where you want to achieve... someone might be able to help.
Tams is offline  
Reply With Quote
Old 06-05-2009, 03:27 AM   #3

simterann22's Avatar

Join Date: May 2009
Location: Sydney
Posts: 64
Ignore this user

Thanks: 42
Thanked 51 Times in 20 Posts



Re: Painting 'trigger' Bar Color to Scalper Alert

Here is an image of the trigger bar....
Attached Thumbnails
Painting 'trigger' Bar Color to Scalper Alert-es-trigger.jpg  
simterann22 is offline  
Reply With Quote
Old 06-05-2009, 10:28 AM   #4

Tams's Avatar

Join Date: Sep 2008
Location: Geelong
Posts: 3,590
Ignore this user

Thanks: 2,027
Thanked 1,402 Times in 862 Posts



Re: Painting 'trigger' Bar Color to Scalper Alert

Quote:
Originally Posted by simterann22 »
Hi guys.....

can someone please help me....I've been racking my brains for hours

I don't like to ask unless I've tried myself though... so here it is:

I like to use the Scalper Alert but would like to see the trigger bar painted to get an early warning of the swing high bar being painted....similar to PBFs yellow trigger bars.

Thanks a lot.


What modifications have you tried?

I have not looked at the code yet; I don't want to duplicate your effort if you have proved that does not work.
Tams is offline  
Reply With Quote
Old 06-07-2009, 08:30 PM   #5

simterann22's Avatar

Join Date: May 2009
Location: Sydney
Posts: 64
Ignore this user

Thanks: 42
Thanked 51 Times in 20 Posts



Re: Painting 'trigger' Bar Color to Scalper Alert

For my other projects I have written extra code for but this one I did not know where to find the "trigger' bar in the code. So to answer your question I have not written any new code as such. I figured if I could find this then it's just a simple 'plot' command.....
simterann22 is offline  
Reply With Quote
Old 06-07-2009, 11:45 PM   #6

Join Date: Feb 2007
Location: US
Posts: 314
Ignore this user

Thanks: 86
Thanked 204 Times in 89 Posts



Re: Painting 'trigger' Bar Color to Scalper Alert

Quote:
Originally Posted by simterann22 »
For my other projects I have written extra code for but this one I did not know where to find the "trigger' bar in the code. So to answer your question I have not written any new code as such. I figured if I could find this then it's just a simple 'plot' command.....
You should read the original thread again. You may be confusing Heikin-Ashi trend or 'TTM trend' paintbars with the Scalper. The picture you attached does not show the actual bar that the scalper was back-painted. This one does:



http://www.traderslaboratory.com/for...html#post60743
thrunner is offline  
Reply With Quote
The Following User Says Thank You to thrunner For This Useful Post:
Tams (06-07-2009)
Old 06-10-2009, 08:19 PM   #7

sunilrohira's Avatar

Join Date: Sep 2008
Location: San Ramon
Posts: 84
Ignore this user

Thanks: 137
Thanked 19 Times in 12 Posts



Re: Painting 'trigger' Bar Color to Scalper Alert

Is it possible to get an .ELD file of the above. Thanks.
sunilrohira is offline  
Reply With Quote

Reply

Tags
paintbar

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
Volume Weighed Color Bars Tams Trading Indicators 14 07-03-2009 10:35 AM
Finding Hex Color Values for TS? daedalus Coding Forum 4 04-01-2009 03:29 PM
Help Detecting Color Changes in MA (TS) ephi144 Coding Forum 2 11-25-2008 10:31 AM
Afraid of Pulling the Trigger? Soultrader Trading Articles 7 11-23-2008 09:21 AM
Scalper Software - Real Time Scalper Dots and Close Forecasting metalhead Technical Analysis 13 10-31-2008 03:33 AM

All times are GMT -4. The time now is 05:06 AM.
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
CS to VB integration by DeskLancer
©2006-2011 Traders Laboratory, All Rights Reserved.