Need help creating an EA using the Bollinger Squeeze with Stochastic indicator - page 2

 

Here is what happened when I tried the following

Thanks. I tried the following. When I went to open up the chart it just gives me a grey screen.

double bsquezup = iCustom(Symbol(),0,"Bollinger Squeeze v8", 1, 14,50, 13,0,1);

double bsquezdown = iCustom(Symbol(),0,"Bollinger Squeeze v8", 1, 14, 50, 13, 1,1);

I'm not sure where I'm going wrong.

 

I changed the the "symbol () to NULL but no dice

I tried changing the "Symbol ()" to NULL but that didn't work either.

double bsquezup = iCustom(NULL, 0,"Bollinger Squeeze v8", 1, 14,50, 13,0,1);

double bsquezdown = iCustom(NULL, 0,"Bollinger Squeeze v8", 1, 14, 50, 13, 1,1);

Any ideas? Sorry I don't have much experience with the iCustom call in order to call this indicator correctly into my EA.

 

No idea thought i was pretty good at adding iCustom indicators to Ea's but this one has got me stumpted, know there is an advanced Bollinger Squeeze floating around the forum somewhere, think it has Stochastic maybe try that version.

 

iCustom for Bollinger Squeeze v8

JGuillen3:
I tried changing the "Symbol ()" to NULL but that didn't work either.

double bsquezup = iCustom(NULL, 0,"Bollinger Squeeze v8", 1, 14,50, 13,0,1);

double bsquezdown = iCustom(NULL, 0,"Bollinger Squeeze v8", 1, 14, 50, 13, 1,1);

Any ideas? Sorry I don't have much experience with the iCustom call in order to call this indicator correctly into my EA.

Hi JGuillen3,

The Bollinger Squeeze v8 indicator has 6 extern variables that need to be included for the iCustom:

//extern string note1 = "Filter the Bollinger Band with";

//extern string note2 = "1=Stoch; 2=CCI, 3=RSI";

extern int triggerType=1;

extern int stochPeriod_trigger1=14;

extern int cciPeriod_trigger2=50;

extern int rsiPeriod_trigger3=13;

I blanked out the 2 extern notes in the indicator so I could use just the 4 extern variables in the iCustom example you and MTools provided (you both were close).

I then did a basic EA that called and displayed the values for all 6 buffers:

double upB = iCustom(Symbol(),0,"Bollinger Squeeze v8", 1, 14, 50, 13, 0,1);

double loB = iCustom(Symbol(),0,"Bollinger Squeeze v8", 1, 14, 50, 13, 1,1);

double upB2 = iCustom(Symbol(),0,"Bollinger Squeeze v8", 1, 14, 50, 13, 2,1);

double loB2 = iCustom(Symbol(),0,"Bollinger Squeeze v8", 1, 14, 50, 13, 3,1);

double mm = iCustom(Symbol(),0,"Bollinger Squeeze v8", 1, 14, 50, 13, 4,1);

double cciline = iCustom(Symbol(),0,"Bollinger Squeeze v8", 1, 14, 50, 13, 5,1);

Attached is my screen shots showing the Bollinger Squeeze v8 values on the chart for my EA.

Hope this helps,

Robert

Files:
 

Thanks for the insight. It makes sense.

Thanks for the insight on the "Bollinger Squeeze V8" code. I did add it and it still bombed so I know my code is faulty. For some reason it's bombing when I click on "Open Chart" to see what it will display. I have attached the EA so you can see what it looks like. Frankly I don't see the syntax error but maybe you can see where I'm going wrong with this. It compiles fine but it won't display the chart.

 

Works Fine For Me

JGuillen3:
Thanks for the insight on the "Bollinger Squeeze V8" code. I did add it and it still bombed so I know my code is faulty. For some reason it's bombing when I click on "Open Chart" to see what it will display. I have attached the EA so you can see what it looks like. Frankly I don't see the syntax error but maybe you can see where I'm going wrong with this. It compiles fine but it won't display the chart.

Hi JG,

Your EA worked fine for me right out of the box (as the saying goes).

A couple of quick comments and questions....

The EA compiles fine and there seems to be no syntax errors or problems. It actually trades ok. Have you run other EA's ok on the same computer? If the code is ok, then it must be something in the steps you are doing to run it?

I would suggest testing your EA with the UseHourTrade=False. You want to get it working first, then fine tune it with session hours after you get any kind of trades to know it's working OK.

Line 19-24 - extern variables for the Stoch are not needed in your EA...your EA iCustom calls the variables directly in your formula (1,14,50,13). Those two blanked extern variables are just needed to be blanked out in the indicator and you can delete these lines from your EA.

You do not seem to be using the Stoch variables you are getting from your iCustom call? The code is correct and the indicator displays OK after testing.

It looks like for now you are just using 34MA for everything...and in the quick test runs I did...the crossing Close[0] and the 34MA seems to give a lot of false crosses with lots of losing trades. The Bolli's may be a helpful filter here.

In any case, your EA works fine for me immediately just using defaults (see my screen shot)....and while I understand your frustration, using words like "bombing" is not a helpful description that tells us anything for us to help you solve the problem...so without a step by step list of what you are actually doing and trying...I don't have a clue why you get a blank chart...when it works fine for me??

Hope you get your EA running soon...because once it's working, the fun part is in adding the Bolli and other filters and testing and tweaking your baby EA till you get some sweet results!

Hope this helps,

Robert

 

Bombing explained

Sorry your right. Bombing could mean a lot of things. I'm including a snapshot of what I mean. Essentially, once I add the Bollinger Squeeze V8 to the code this is what my screen looks like. It's just grey with horizontal black lines. And yes your right, at this stage I'm just trying to get the indicator to appear in the chart. The actual trades I plan to code after I figure out what I'm doing wrong as to why the chart doesn't come up. Okay, here is the screenshot. Oh yes I forgot to mention my other EA's work okay as far as displaying correctly on the chart, this is the only one I'm having a problem with. Thanks.

 
JGuillen3:
Sorry your right. Bombing could mean a lot of things. I'm including a snapshot of what I mean. Essentially, once I add the Bollinger Squeeze V8 to the code this is what my screen looks like. It's just grey with horizontal black lines. And yes your right, at this stage I'm just trying to get the indicator to appear in the chart. The actual trades I plan to code after I figure out what I'm doing wrong as to why the chart doesn't come up. Okay, here is the screenshot. Oh yes I forgot to mention my other EA's work okay as far as displaying correctly on the chart, this is the only one I'm having a problem with. Thanks.

If you are using icustom, that is symptomatic of wrong parameters in your icustom line

 

This might help I hope

I right clicked on the chart and it showed that there were over 200 indicator windows. Could it be that I added the indicator in the wrong section of the program?

 

Need To Know The Steps You Are Taking

JGuillen3:
I right clicked on the chart and it showed that there were over 200 indicator windows. Could it be that I added the indicator in the wrong section of the program?

Thanks JG,

The screen shots are helpful to see what you are talking about....but I am not able to replicate your problem and we still need your...."step by step" list of what you are doing and how you actually got there, including broker, smiley faces, using demo chart or strategy tester, journal logs, error messages, etc....so we can say for example....at step 6 you need to try this instead.

You also might prove the indicator is ok all by itself by dropping it on a new chart without the EA. If the indicator by itself doesn't work, this may give you more clues. If it does work...then we are back to what steps you are doing/not doing to get the EA running.

It is interesting to see the number of indicators that got installed...and that does suggests some problem, although I do not get that problem (the BB indicator only loads once for me and is in the correct code section). Again without knowing what you are actually doing (step by step process) to get all those indicators and a blank chart, I'm running out of suggestions here.

Other testers are needed....

At this point, if others could help confirm that your basic EA code does work for them (as it does for me), then we can isolate the problem down to the steps you are taking (or not taking) to get your EA running.

Attached is a screen shot of AudUsd M15 to show you that your EA actually does work which should encourage you to keep going. I'll reserve the congratulations for you until you get it running for yourself...but good start...and don't give up!

Hope this helps,

Robert

Reason: