Jump to content

Welcome to the new Traders Laboratory! Please bear with us as we finish the migration over the next few days. If you find any issues, want to leave feedback, get in touch with us, or offer suggestions please post to the Support forum here.

  • Welcome Guests

    Welcome. You are currently viewing the forum as a guest which does not give you access to all the great features at Traders Laboratory such as interacting with members, access to all forums, downloading attachments, and eligibility to win free giveaways. Registration is fast, simple and absolutely free. Create a FREE Traders Laboratory account here.

simterann22

Painting 'trigger' Bar Color to Scalper Alert

Recommended Posts

Hi guys.....

 

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

 

I don't like to ask unless I've tried myself though... :doh: 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.

 

{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.

Share this post


Link to post
Share on other sites
Hi guys.....

 

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

 

I don't like to ask unless I've tried myself though... :doh: 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.

Share this post


Link to post
Share on other sites

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.....

Share this post


Link to post
Share on other sites
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:

 

9732d1236871839-scalper-buys-sell-replica-scalper2009-03-12_113013.gif

 

http://www.traderslaboratory.com/forums/46/scalper-buys-sell-replica-2124-2.html#post60743

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.