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)) );
}
TTM Scalper - EFS
Moderator: moderators
Scalper Buy Sell - eSignal version
- Attachments
-
- ScalperBuySell.efs
- (2.54 KiB) Downloaded 701 times
Please add www.kreslik.com to your ad blocker white list.
Thank you for your support.
Thank you for your support.
-
- rank: <50 posts
- Posts: 7
- Joined: Thu Aug 02, 2007 1:50 pm
- Reputation: 0
- Gender:
- Contact:
Scalper Buy Sell
Hey rebkwez,
good job!
Thanks
rob
good job!
Thanks
rob
-
- rank: <50 posts
- Posts: 7
- Joined: Thu Aug 02, 2007 1:50 pm
- Reputation: 0
- Gender:
- Contact:
TTM Scalper Buy Sell
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
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
Re: TTM Scalper Buy Sell
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
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
-
- rank: <50 posts
- Posts: 7
- Joined: Thu Aug 02, 2007 1:50 pm
- Reputation: 0
- Gender:
- Contact:
TTM Scalper
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
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.
Thank you for your support.
Re: TTM Scalper - EFS
Great Post
Please add www.kreslik.com to your ad blocker white list.
Thank you for your support.
Thank you for your support.