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.

chrisleonard

Squeeze Alert Help

Recommended Posts

Hi Guys :crap:

 

I am modifying the sqeeze to alert me when its on buycolour 1 and buycolour2

 

 

here is the squeeze im using from here!!

 

Inputs: Price(Close), price2(close),Price3(H/3+L/3+C/3), 
 Length(20), 
 Length2(13), 
 Length3(21), 
 Length4(9), 
 Style(1), 
 nK(1.5),  
 nBB(2),  
	 AlertLine( 1 ), 
 BuyColor1(blue), BuyColor2(darkblue), 
 SellColor1(red), SellColor2(darkred), 
 NormalColor(Red),AlertColor(Blue), 
 CounterTrend(true);  

vars:FastVal1(0), SlowVal1(0), Diff1(0), 
    FastVal2(0), SlowVal2(0), Diff2(0), 
    FastVal3(0), SlowVal3(0), Diff3(0), 
    FastVal4(0), SlowVal4(0), Diff4(0), 
    AvgDiff(0), AvgDif(0), poles(4), 
    CCIValue(0),DownCT(0),UpCT(0),SDev(0),ATR(0),LHMul t(0),Denom(0),BBS_Ind(0); 

if Style = 0 then begin 
{Zero Line - BB Squeeze} 
if ( barnumber=1 ) then  
Begin 
  If minmove <> 0 then 
    LHMult = pricescale/minmove; 
end; 

{-- Calculate BB Squeeze ----------------------} 
ATR = AvgTrueRange(Length); 
SDev = StandardDev(Price, Length, 1); 

Denom = (nK*ATR); 
If Denom <> 0 then BBS_Ind = (nBB * SDev) /Denom;  

If BBS_Ind < Alertline then 
  SetPlotColor(1, NormalColor) 
else 
  SetPlotColor(1, AlertColor); 

{-- Plot Index & Alert Line -------------------------} 
Plot1(0, "Squeeze"); 
end; 

if Style = 1 then begin 
{Zero Line - Gauss filter} 
value1 = Gauss(Price3,Length3,3); 

if (Value1) > (Value1[1]) then  
SetPlotColor(1, BuyColor1); 
if (Value1) < (Value1[1]) then  
SetPlotColor(1, SellColor1); 
//SetPlotWidth(1,7); 
Plot1(0, "Squeeze"); 
end; 


{Histogram}  
FastVal1 = Gauss(price, 8, poles); 
SlowVal1 = Gauss(price, 21, poles); 
Diff1 = FastVal1 - SlowVal1; 
FastVal2 = Gauss(price, 13, poles); 
SlowVal2 = Gauss(price, 34, poles); 
Diff2 = FastVal2 - SlowVal2; 
FastVal3 = Gauss(price, 21, poles); 
SlowVal3 = Gauss(price, 55, poles); 
Diff3 = FastVal3 - SlowVal3; 
FastVal4 = Gauss(price, 34, poles); 
SlowVal4 = Gauss(price, 89, poles); 
Diff4 = FastVal4 - SlowVal4; 
AvgDiff = (Diff1+Diff2+Diff3+Diff4)/4; 

plot2(AvgDiff,"DiffHisto") ; 
//setplotwidth(2,7); 
if AvgDiff > 0 then  
 if AvgDiff > AvgDiff[1] then  
   setplotcolor(2,BuyColor1) 
 else 
   setplotcolor(2,BuyColor2) ; 

if AvgDiff < 0 then  
 if AvgDiff < AvgDiff[1] then setplotcolor(2,SellColor1) 
else 
 setplotcolor(2,SellColor2); 



{+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++} 
{ Counter Trend Mode} 
if CounterTrend = true then begin 
CCiValue = CCI(13); 

Condition1 = ccivalue[1] > 50; 
Condition2 = CCivalue < 50; 
Condition3 = CCivalue[1] < 100; 
Condition4 = CCiValue > 100; 
Condition5 = AvgDiff > 0; 
Condition6 = AvgDiff[1] > 0; 
Condition7 = AvgDiff[2] > 0; 
Condition8 = ccivalue < 100; 

if Condition1 and Condition2 and Condition5 and condition6 and condition7 then begin 
  setplotcolor(2,SellColor2); 
  DownCT = 1; 
end; 

if DownCT = 1 and AvgDiff < 0 then DownCT =0; 

if DownCT = 1 and Condition8 and Condition5 then setplotcolor(2,SellColor2); 

if DownCT = 1 and Condition3 and Condition4 then begin 
  setplotcolor(2,BuyColor1); 
  DownCT = 0; 
end; 

Condition11 = ccivalue[1] < -50; 
Condition12 = CCivalue > -50; 
Condition13 = CCivalue[1] >- 100; 
Condition14 = CCiValue < -100; 
Condition15 = AvgDiff < 0; 
Condition16 = AvgDiff[1] < 0; 
Condition17 = AvgDiff[2] < 0; 
Condition18 = ccivalue >-100; 

if Condition11 and Condition12 and Condition15 and condition16 and condition17 then begin 
  setplotcolor(2,BuyColor2) ; 
  UpCT = 1; 
end; 

if UpCT = 1 and AvgDiff > 0 then UpCT =0; 
if UpCT = 1 and Condition18 and Condition15 then setplotcolor(2,BuyColor2) ; 
if UpCT = 1 and Condition13 and Condition14 then begin 
  setplotcolor(2,SellColor1); 
  UpCT = 0; 
end; 

end; 

 

I have added this into the squeeze

 

 

if Style = 1 then

begin

{Zero Line - Gauss filter}

value1 = Gauss(Price3,Length3,3);

 

if (Value1) > (Value1[1]) then

BEGIN

SetPlotColor(1, BuyColor1);

ALERT("BUYCOLOR1");

END;

if (Value1) < (Value1[1]) then

BEGIN

SetPlotColor(1, SellColor1);

ALERT("BUYCOLOR2");

END;

//SetPlotWidth(1,7);

Plot1(0, "Squeeze");

end;

 

but i still get alerts when it fires red sometimes, there must be a way to get this only to fire if the histogram is BUYCOLOR1 or BUYCOLOR2.

 

Im going round in circles

 

Heres and example of where it fired where it should not.. There is a yellow dot where it fired!

Its also done it on red on the downside...

 

sq.png

 

thanks for any help, i have tried to be as specific as i can in the problem im having!

Thanks f

Edited by chrisleonard

Share this post


Link to post
Share on other sites
...

Heres and example of where it fired where it should not.. There is a yellow dot where it fired!

Its also done it on red on the downside...

 

sq.png

 

thanks for any help, i have tried to be as specific as i can in the problem im having!

Thanks f

 

 

you have to be VERY specific

 

put the chart on Paint, use lines and arrows and notes to point out the following: (pls answer ALL questions one by one)

 

1. what is the code doing right now.

2. which is the good trigger?

3. which is the wrong trigger?

4. what do you want the code to do?

5. what do you NOT want the code to do?

 

right now i see a yellow dot... but I don't understand your mumble jumble.

 

you have asked a lot of questions in the past,

I have always give one suggestion, which you have not considered:

 

write out your thoughts ONE LINE at a time,

write out your actions ONE LINE at a time,

 

if your write more than one action in one line,

you are guaranteed to get confused.

Edited by Tams

Share this post


Link to post
Share on other sites

Hi

 

Sorry i didn try to explain properly and i did do what you said.

 

Seriously i have got so fat since the Text on Chart post and you have really helped!

 

I have also written out my logic step by step which has got me this far but im still haveing this problem!!

 

The yellow dot in the poicture i did using paintbrush to show where i was getting an alert in the wrong place!!

 

 

The problem is it fires in all the right places but still fires sometimes where i have pointed out with the yello dot!!

 

 

Here is the code i have written into the original squeeze code from here!!

 

Inputs: Price(Close), price2(close),Price3(H/3+L/3+C/3), 
 Length(20), 
 Length2(13), 
 Length3(21), 
 Length4(9), 
 Style(1), 
 nK(1.5),  
 nBB(2),  
	 AlertLine( 1 ), 
 BuyColor1(blue), BuyColor2(darkblue), 
 SellColor1(red), SellColor2(darkred), 
 NormalColor(Red),AlertColor(Blue), 
 CounterTrend(true);  

vars:FastVal1(0), SlowVal1(0), Diff1(0), 
    FastVal2(0), SlowVal2(0), Diff2(0), 
    FastVal3(0), SlowVal3(0), Diff3(0), 
    FastVal4(0), SlowVal4(0), Diff4(0), 
    AvgDiff(0), AvgDif(0), poles(4), 
    CCIValue(0),DownCT(0),UpCT(0),SDev(0),ATR(0),LHMul t(0),Denom(0),BBS_Ind(0); 

if Style = 0 then begin 
{Zero Line - BB Squeeze} 
if ( barnumber=1 ) then  
Begin 
  If minmove <> 0 then 
    LHMult = pricescale/minmove; 
end; 

{-- Calculate BB Squeeze ----------------------} 
ATR = AvgTrueRange(Length); 
SDev = StandardDev(Price, Length, 1); 

Denom = (nK*ATR); 
If Denom <> 0 then BBS_Ind = (nBB * SDev) /Denom;  

If BBS_Ind < Alertline then 
  SetPlotColor(1, NormalColor) 
else 
  SetPlotColor(1, AlertColor); 

{-- Plot Index & Alert Line -------------------------} 
Plot1(0, "Squeeze"); 
end; 


------------------------- this is where i made changes!!!--------------------------------------------
if Style = 1 then begin 
{Zero Line - Gauss filter} 
value1 = Gauss(Price3,Length3,3); 

if (Value1) > (Value1[1]) then
BEGIN
SetPlotColor(1, BuyColor1);
ALERT("BUYCOLOR1"); <-----------------------------------------here
END;
if (Value1) < (Value1[1]) then
BEGIN
SetPlotColor(1, SellColor1);
ALERT("BUYCOLOR2"); < ----------------------------------------here 
END;
//SetPlotWidth(1,7);
Plot1(0, "Squeeze");
end; 


-------------------------------------------------------------------------------------------------------------------

{Histogram}  
FastVal1 = Gauss(price, 8, poles); 
SlowVal1 = Gauss(price, 21, poles); 
Diff1 = FastVal1 - SlowVal1; 
FastVal2 = Gauss(price, 13, poles); 
SlowVal2 = Gauss(price, 34, poles); 
Diff2 = FastVal2 - SlowVal2; 
FastVal3 = Gauss(price, 21, poles); 
SlowVal3 = Gauss(price, 55, poles); 
Diff3 = FastVal3 - SlowVal3; 
FastVal4 = Gauss(price, 34, poles); 
SlowVal4 = Gauss(price, 89, poles); 
Diff4 = FastVal4 - SlowVal4; 
AvgDiff = (Diff1+Diff2+Diff3+Diff4)/4; 

plot2(AvgDiff,"DiffHisto") ; 
//setplotwidth(2,7); 
if AvgDiff > 0 then  
 if AvgDiff > AvgDiff[1] then  
   setplotcolor(2,BuyColor1) 
 else 
   setplotcolor(2,BuyColor2) ; 

if AvgDiff < 0 then  
 if AvgDiff < AvgDiff[1] then setplotcolor(2,SellColor1) 
else 
 setplotcolor(2,SellColor2); 



{+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++} 
{ Counter Trend Mode} 
if CounterTrend = true then begin 
CCiValue = CCI(13); 

Condition1 = ccivalue[1] > 50; 
Condition2 = CCivalue < 50; 
Condition3 = CCivalue[1] < 100; 
Condition4 = CCiValue > 100; 
Condition5 = AvgDiff > 0; 
Condition6 = AvgDiff[1] > 0; 
Condition7 = AvgDiff[2] > 0; 
Condition8 = ccivalue < 100; 

if Condition1 and Condition2 and Condition5 and condition6 and condition7 then begin 
  setplotcolor(2,SellColor2); 
  DownCT = 1; 
end; 

if DownCT = 1 and AvgDiff < 0 then DownCT =0; 

if DownCT = 1 and Condition8 and Condition5 then setplotcolor(2,SellColor2); 

if DownCT = 1 and Condition3 and Condition4 then begin 
  setplotcolor(2,BuyColor1); 
  DownCT = 0; 
end; 

Condition11 = ccivalue[1] < -50; 
Condition12 = CCivalue > -50; 
Condition13 = CCivalue[1] >- 100; 
Condition14 = CCiValue < -100; 
Condition15 = AvgDiff < 0; 
Condition16 = AvgDiff[1] < 0; 
Condition17 = AvgDiff[2] < 0; 
Condition18 = ccivalue >-100; 

if Condition11 and Condition12 and Condition15 and condition16 and condition17 then begin 
  setplotcolor(2,BuyColor2) ; 
  UpCT = 1; 
end; 

if UpCT = 1 and AvgDiff > 0 then UpCT =0; 
if UpCT = 1 and Condition18 and Condition15 then setplotcolor(2,BuyColor2) ; 
if UpCT = 1 and Condition13 and Condition14 then begin 
  setplotcolor(2,SellColor1); 
  UpCT = 0; 
end; 

end;

Share this post


Link to post
Share on other sites
....

 

The yellow dot in the poicture i did using paintbrush to show where i was getting an alert in the wrong place!!

 

 

The problem is it fires in all the right places but still fires sometimes where i have pointed out with the yello dot!!

....

 

 

I still don not understand...

does the yellow dot show the WRONG trigger?

or the yellow dot show the correct trigger?

in your previous post, you were complaining about the wrong places as the green.

where are the correct places?

 

do this:

make 2 charts

 

chart 1. make arrows and lines and notes to show where you want the triggers.

(this is your mock up. without this chart, you do not have clarity of what you want)

 

chart 2. make arrows and lines and notes to show the wrong triggers given by your code.

(this is the diagnostics)

Edited by Tams

Share this post


Link to post
Share on other sites

hmmmmm

 

ok this is my new squeeze,

 

 

 

FastVal1 = ProSqFunc(price, 8, poles);

SlowVal1 = ProSqFunc(price, 21, poles);

Diff1 = FastVal1 - SlowVal1;

FastVal2 = ProSqFunc(price, 13, poles);

SlowVal2 = ProSqFunc(price, 34, poles);

Diff2 = FastVal2 - SlowVal2;

FastVal3 = ProSqFunc(price, 21, poles);

SlowVal3 = ProSqFunc(price, 55, poles);

Diff3 = FastVal3 - SlowVal3;

FastVal4 = ProSqFunc(price, 34, poles);

SlowVal4 = ProSqFunc(price, 89, poles);

Diff4 = FastVal4 - SlowVal4;

AvgDiff = (Diff1+Diff2+Diff3+Diff4)/4;

 

if AvgDiff > 0 then

if AvgDiff > AvgDiff[1] then begin

ALERT("BUYCOLOR1");

end;

 

I thought this would take out the majority of problems but it is still alerting on reds!!!

 

here is an egsample of it being wrong!!

 

problem.jpg

Edited by chrisleonard

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.


  • Topics

  • Posts

    • ...hallucinates.... Student: “What if we gave the monkey LSD?” Guru: “The monkey already did LSD”
    • Question: To those that had/have cancer, what were the signs that made you think “something is not right here” to make you go see a doctor? Answer: So, 5/25/2018, I woke up, got ready for work, and as I walked to my car, I started gagging. Like something was stuck in my throat and I needed to clear it. And then it went away.   But 10 minutes after that, I was T-boned at 40mph on the driver side door. But what made me see a doctor was while my muscles felt better and bruises were going away, the gagging still continued, I started having fevers, my neck felt swollen, I was having such a hard time breathing, and I'd have random sharp pains in my chest, but not from where the seat belt saved me.   2 weeks after the accident, I finally see an urgent care doctor, who looks me over, tells me I'm fine, but luckily requests a neck X-ray. And I ask for a chest X-ray, which he rolls his eyes but let me have (most of my pain was in the neck, so I understand).   The very next day, he calls and says “So, that chest X-ray shows there's a 4 inch mass on your heart and lungs, and your lungs have been filling up with fluid, as well as in your pericardial (heart) wall. We need you to come in tomorrow.”   Turns out the big mass, due to the accident, caused my heart and lungs to tear and fill with fluid, the swollen neck and gagging was caused by 2 metastasized tumors, and the fevers and weight loss were symptoms. Stage 4b Hodgkin's Lymphoma.   But thankfully, we went very aggressive with chemo (and had a lot of bad side effects that don't normally happen to patients), and now I'm about 16 months cancer-free. Yay lucky X-rays! Rachel Jurina, Quora Source: https://www.quora.com/To-those-that-had-have-cancer-what-were-the-signs-that-made-you-think-something-is-not-right-here-to-make-you-go-see-a-doctor   Profits from free accurate cryptos signals: https://www.predictmag.com/  
    • As a man, the reality of life is the harshest part. I don’t mind looking older or becoming weaker over time; it’s nature.   Have you ever heard that the only people who will be loved unconditionally are women and children? Men will only be loved as long as they can provide until they are no longer needed. It doesn’t matter if you already did your best to get your kids to the best school or get the best things for them, if you stop before they’re done with it, there will be no thank you. The only thing they will remember is that they have to quit school at 15, ignoring all the previous 15 years of life you provided for them. The only people who will accept you, no matter what, are your parents. But in this situation, you might be that ungrateful child.   EDIT: Wow, I didn’t think this would get so much attention.   For those who disagree, I can only say that everyone has their problem. If you don’t get the chance to face such a thing, be grateful. Remember, sometimes what you throw in the garbage is something that someone wishes ever to have.” – ElZee, Quora   Profits from free accurate cryptos signals: https://www.predictmag.com/    
    • The good thing i had noticed so far is that the traderpot value is also on the rise..
    • yup its a gradual rollout the right way in my opinion, its really good and its exciting for the sto in 2027
×
×
  • Create New...

Important Information

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