Hello all,
Here is the code for the squeeze. I would like to know if someone could add an alert for when the black dot appears? I would like to run this indicator on several charts and time frames and it gets confusing and tiring flipping thru charts all day.
Thanks to all for a super site and super work!
function preMain() {
setStudyTitle("FPSqueeze");
setCursorLabelName("FPSqueeze", 0);
setDefaultBarFgColor(Color.blue, 0);
setPlotType(PLOTTYPE_HISTOGRAM,0);
setDefaultBarThickness(4,0);
//addBand(0,PS_SOLID,1,Color.black,"zero");
var BBlow=null;
var BBhigh=null;
var KClow=null;
var KChigh=null;
var Mom=null;
var vHigh=null;
var vLow=null;
var vClose=null;
var fp1 = new FunctionParameter("nMA", FunctionParameter.NUMBER);
fp1.setName("Squeeze Moving Average");
fp1.setLowerLimit(1);
fp1.setDefault(20);
var fp2 = new FunctionParameter("nSD", FunctionParameter.NUMBER);
fp2.setName("Standard Deviation");
fp2.setLowerLimit (1);
fp2.setDefault(2.0);
var fp3 = new FunctionParameter("nColorSqueeze", FunctionParameter.COLOR);
fp3.setName("Squeeze Color");
fp3.setDefault(Color.red);
var fp4 = new FunctionParameter("nColorAction", FunctionParameter.COLOR);
fp4.setName("Action Color");
fp4.setDefault(Color.lime);
}
function ATR(nInputLength) {
var dSum = 0;
var dH = high(0, -nInputLength);
var dL = low(0, -nInputLength);
var dC = close(-1, -nInputLength);
if (dH == null || dL == null || dC == null) {
return;
}
for (i = 0; i < nInputLength; ++i) {
var vTrueHigh = Math.max(dH[i], dC[i]);
var vTrueLow = Math.min(dL[i], dC[i]);
var vTrueRange = (vTrueHigh - vTrueLow);
dSum += vTrueRange;
}
dSum /= nInputLength;
return dSum;
}
function main(nMA, nSD, nColorSqueeze, nColorAction) {
//Bollinger Band Variables using 1.4 Standard Deviation
var myStudy1 = upperBB (nMA,nSD);
var myStudy2 = lowerBB (nMA,nSD);
var momStudy1 = ema(10,mom(12));
var macdstudy = new macdHist(12,26,9);
BBlow = myStudy2.getValue(0);
BBhigh = myStudy1.getValue(0);
Mom = momStudy1.getValue(0);
macdvalue = macdstudy.getValue(0);
var BarCntr;
var nRangeFactor = 1.5;
if (getBarState() == BARSTATE_NEWBAR)
BarCntr += 1;
if (BarCntr < nMA) {
return;
} else {
var dKeltnerBasis= call("/Library/KeltnerEMA.efs", nMA);
var dATR = ATR(nMA);
KClow = (dKeltnerBasis - (nRangeFactor * dATR));
KChigh = (dKeltnerBasis + (nRangeFactor * dATR));
}
//Logic to create red or blue squeeze signal
if ((BBhigh <= KChigh) || (BBlow >= KClow)) {
drawShapeRelative(0,0,Shape.CIRCLE,null,nColorSqueeze,Shape.TOP);
}
if ((BBhigh > KChigh) || (BBlow < KClow)) {
drawShapeRelative(0,0,Shape.CIRCLE,null,nColorAction,Shape.TOP);
}
if (Mom > 0) {
setBarFgColor(Color.blue);
}
else {
setBarFgColor(Color.red);
}
drawTextPixel( 1, 93, "Squeeze ", Color.black, null, Text.RELATIVETOLEFT | Text.RELATIVETOBOTTOM | Text.BOLD, "Arial",10 );
return ((Mom+macdvalue)/2);
}
The "Squeeze"
Moderator: moderators
Please add www.kreslik.com to your ad blocker white list.
Thank you for your support.
Thank you for your support.
-
- rank: 150+ posts
- Posts: 152
- Joined: Sat Jul 29, 2006 9:16 pm
- Reputation: 0
- Location: Geneva, FL
- Gender:
TxTrader or anybody who may know,
Do you know how to create the darker shading on the backing off side of the histogram bars? Also, you talked about a black dot but I haven't seen one. Do you have a screenshot where one occured so I may reproduce the signal? I'm using AB - what symbol(s) are you using?
Kirk
Alex,
go to TTM (Trade the Markets) or search for TTM or squeeze. TRO had a link I'm trying to find where Hubert (from TTM) explains it. If I can find I will post.
Do you know how to create the darker shading on the backing off side of the histogram bars? Also, you talked about a black dot but I haven't seen one. Do you have a screenshot where one occured so I may reproduce the signal? I'm using AB - what symbol(s) are you using?
Kirk
Alex,
go to TTM (Trade the Markets) or search for TTM or squeeze. TRO had a link I'm trying to find where Hubert (from TTM) explains it. If I can find I will post.
Please add www.kreslik.com to your ad blocker white list.
Thank you for your support.
Thank you for your support.
-
- rank: 150+ posts
- Posts: 152
- Joined: Sat Jul 29, 2006 9:16 pm
- Reputation: 0
- Location: Geneva, FL
- Gender:
I know the Tradestation forum (not necessarily on Kreslik) had a revised squeeze version with an extra dot but I haven't seen in e-signal. Thanks for the screenshot. Was FPsqueeze on the esignal forum? (if you can say where you got or if you coded it?) FWIW, I'm testing with Bollinger and Keltner bands. I think I understand the setup for when you enter long but not when a short position is setup. If anyone knows, please reply or post a screenshot with entry notes. Thanks in advance.
Kirk
Kirk
zeller,
I think the black dot is a preliminary signal, like one band/upper or lower of BB has broken out of Keltner channels, then the full signal is when both break out. Just an idea.
On the short/long position, this only a momentum play, so therefore if the histogram is red then sell, blue then buy. Or you can use another indicator that you are comfortabel with that tends to show market direction.
TRO has been gracious enough to supply plenty! Thanks TRO.
Good trading,
oh, this code is in the Esignal database under the Forex group and at Forexproject.com.
I think the black dot is a preliminary signal, like one band/upper or lower of BB has broken out of Keltner channels, then the full signal is when both break out. Just an idea.
On the short/long position, this only a momentum play, so therefore if the histogram is red then sell, blue then buy. Or you can use another indicator that you are comfortabel with that tends to show market direction.
TRO has been gracious enough to supply plenty! Thanks TRO.
Good trading,
oh, this code is in the Esignal database under the Forex group and at Forexproject.com.
- Patch
- rank: 500+ posts
- Posts: 941
- Joined: Sat Jan 06, 2007 6:13 pm
- Reputation: 0
- Location: Virginia
- Real name: Jeff
- Gender:
- Contact:
Hi Tyler19
Could you post a chart for guys like me that don't have Esignal ao I can see what you are talking about.
Thanks
Jeff in VA
Could you post a chart for guys like me that don't have Esignal ao I can see what you are talking about.
Thanks
Jeff in VA
ENOUGH being a Yalie for me Back to the Sea. "What i can lose, i can win" "YES YOU CAN" - dragon33 -"Pick one method and one pair and stick with them until you master it. "The choice is yours - success or failure." TRO
Please add www.kreslik.com to your ad blocker white list.
Thank you for your support.
Thank you for your support.