TTM Scalper - EFS

eSignal indicators

Moderator: moderators

rebkwez
rank: <50 posts
rank: <50 posts
Posts: 8
Joined: Thu Jan 25, 2007 7:24 am
Reputation: 0
Gender: None specified

Scalper Buy Sell - eSignal version

Postby rebkwez » Thu Feb 07, 2008 1:18 pm

Here is the esignal code that I wrote. I'm not completely familiar with TS code, so I did my best in trying to do the conversion. Also used the TTM videos as guidance, but the explanation there is very unlcear.

Esignal doesn't have the PaintBar concept that TS does, so right now a box with a "B" or "S" appears above/below the candlestick that generates the signal. The distance above/below where this box appears is fixed in the code. It probably should be made into a parameter so it can be changed for stocks, fx or futures. For the next version...

If anyone makes any changes to improve on this code, please post it to the list. Thanks.

Elliot


debugClear();

var iColorBuy = new FunctionParameter("iColorBuy", FunctionParameter.COLOR);
iColorBuy.setDefault( Color.green );

var iColorSell = new FunctionParameter("iColorSell", FunctionParameter.COLOR);
iColorSell.setDefault( Color.red );

var iFontSize = new FunctionParameter("iFontSize", FunctionParameter.NUMBER);
iFontSize.setDefault( 10 );

function preMain()
{
setStudyTitle("ScalperBuySell");
setPriceStudy(true);

setShowTitleParameters(false);
setCursorLabelName(false);
}

function main(iColorBuy, iColorSell, iFontSize) {
if(getBarState() == BARSTATE_NEWBAR)
{
//*****************
// SCALPER SELL
if(Three_Higher_Highs() ) {
if( LowerHigh() ) {
if( CloseBelowTrigger() ) {
drawTextRelative(-2, high(-2)+.5, "S", iColorSell ,null, Text.FRAME|Text.CENTER|Text.BOLD|Text.TOP, "Arial", iFontSize,"ScalpS"+ getCurrentBarCount());
}
}
}

//*****************
// SCALPER BUY
if(Three_Lower_Lows() ) {
if( HigherLow() ) {
if( CloseAboveTrigger() ) {
drawTextRelative(-2, low(-2)-.5, "B", iColorBuy ,null, Text.FRAME|Text.CENTER|Text.BOLD|Text.BOTTOM, "Arial", iFontSize ,"ScalpB"+ getCurrentBarIndex());
}
}
}
}

return;
}

function CloseBelowTrigger() {
//return ( close(0) < low(-1) && high(0) < highest(4, high()) );
//return ( close(0) <= low(-1) );

// This one gives more signals.
return ( close(0) <= low(-1) || close(0) <= close(-1) );
}
function LowerHigh() {
return (high(-1) <= high(-2));
}
function Three_Higher_Highs() {
return( (close(-2) >= close(-3) && close(-3) >= close(-4) && close(-4) >= close(-5)) ||
(low(-2) >= low(-3) && low(-3) >= low(-4) && low(-4) >= low(-5)) );
}

function CloseAboveTrigger() {
//return ( close(0) > high(-1) && low(0) > lowest(4, low()) );
//return ( close(0) >= high(-1) );

// This one gives more signals.
return ( close(0) >= high(-1) || close(0) >= close(-1) );
}
function HigherLow() {
return low(-1) >= low(-2)
}
function Three_Lower_Lows() {
return( (close(-2) <= close(-3) && close(-3) <= close(-4) && close(-4) <= close(-5)) ||
(high(-2) <= high(-3) && high(-3) <= high(-4) && high(-4) <= high(-5)) );
}
Attachments
ScalperBuySell.efs
(2.54 KiB) Downloaded 647 times

Please add www.kreslik.com to your ad blocker white list.
Thank you for your support.

Haifeschak
rank: <50 posts
rank: <50 posts
Posts: 7
Joined: Thu Aug 02, 2007 1:50 pm
Reputation: 0
Gender: Male
Contact:

Scalper Buy Sell

Postby Haifeschak » Thu Feb 07, 2008 2:13 pm

Hey rebkwez,

good job!

Thanks

rob

Haifeschak
rank: <50 posts
rank: <50 posts
Posts: 7
Joined: Thu Aug 02, 2007 1:50 pm
Reputation: 0
Gender: Male
Contact:

TTM Scalper Buy Sell

Postby Haifeschak » Fri Feb 08, 2008 5:30 pm

Hey Elliot,

I have made the experience that sometimes the Buy "B" or Sell "S" Signals disappear(e.g. NQ E-mini) and will be placed on a later bar although there are three consecutive higher highs or lower lows! Did you notice the same?

rob

rebkwez
rank: <50 posts
rank: <50 posts
Posts: 8
Joined: Thu Jan 25, 2007 7:24 am
Reputation: 0
Gender: None specified

Re: TTM Scalper Buy Sell

Postby rebkwez » Sat Feb 09, 2008 6:08 pm

Rob,

Hi. Just to point out, this is a "lagging" indicator. It's not meant to be used for entry signals. It looks for 3 higher highs or lower lows and has a couple of other conditions to meet. If all the conditions are met, then it shows you the "B" or "S" on the 1st candlestick of the 3 higher highs or 3 lower lows. I think that's what you mean when you refer to a "later bar".

I personally don't use the indicator, I prefer Avery's BuyZone and GridIron. That's all I have on my screen.

-Elliot

Haifeschak wrote:Hey Elliot,

I have made the experience that sometimes the Buy "B" or Sell "S" Signals disappear(e.g. NQ E-mini) and will be placed on a later bar although there are three consecutive higher highs or lower lows! Did you notice the same?

rob

Haifeschak
rank: <50 posts
rank: <50 posts
Posts: 7
Joined: Thu Aug 02, 2007 1:50 pm
Reputation: 0
Gender: Male
Contact:

TTM Scalper

Postby Haifeschak » Sun Feb 10, 2008 12:30 am

Hey Elliot,

I know that this is a lagging indicator but this is not the problem I noticed.
The problem is that a lagging "B" appears and after a few bars the lagging "B" DISAPPEARS and will be placed a few bars later. I mean that the signal is lagging in general is logic because it will be generated after three higher highs or three lower lows. But why does the signal sometimes disappear? Thats the thing I really do not understand.

regards

rob

Please add www.kreslik.com to your ad blocker white list.
Thank you for your support.

moonll
rank: <50 posts
rank: <50 posts
Posts: 1
Joined: Thu Mar 18, 2010 6:36 am
Reputation: 0
Gender: Male

Postby moonll » Thu Mar 18, 2010 6:40 am

Thanks for sharing!




____________________
<links removed by moderator>

Ritikhose
rank: <50 posts
rank: <50 posts
Posts: 1
Joined: Mon Jan 06, 2020 5:26 am
Reputation: 0
Gender: None specified
Contact:

Re: TTM Scalper - EFS

Postby Ritikhose » Mon Jan 06, 2020 5:29 am

Great Post :D

Please add www.kreslik.com to your ad blocker white list.
Thank you for your support.


Return to “eSignal indicators”