Forex-ID10T EA (Working but not trading!) - page 2

 

OK! IT'sTRADING!!!

Brilliant and THANK YOU both to n8937g and whocares - You have made my day!

With people like you on the forum, I just might become a millionaire one day :)

Now I need to do some additional filtering to make it profitable...

 
because the Z indicator is a lagging indicator
 
Sammasati wrote >>
because the Z indicator is a lagging indicator

Dear Sammasati

I agree 150%.

I only use the ZigZag indicator to monitor if my trade indeed was done close to the high and lows as identified. Pity one cannot MAKE/FORCE the ZigZag into realtime - maybe it could be done but not with my mathematical deprived brain :)

If you have any suggestions and it does not require too much thinking, please shoot!

 

OK - I have been burning some midnight oil and now it is at least showing some promise. It is trading but ONLY BUYING. Can someone please assist this ID10T (Me!) and spot the error or determine from the code why it is only buying and not selling?

Added more bars to eveluate - previously only used Bar 0,1 and 2. Now Bars 3, 5 and 8 are also part of the mix. (Guess who's been reading stuff on Fibo levels?)

Busy running backtest on EUR/CHF on a M15 chart from 01 Jan 2009 up to 01 Jan 2010. On the chart it is showing midnight 20 Jan 2009 and the starting balance of $500 has grown to $646.95. (23% growth in 20 days). The Forex broker account is at AvaFX. Spread is fixed at 4 pips.

EA Settings: Unzip attached forexid10t.zip. I will attach the EA on the next post.

Take Profit: 52

Stop Loss: Not used

Trailing Stop: 26 (50% of Take PRofit)

Target: 90 (Score above this level will determine if BEARS or BULLS rule)

Top Sell: 69 (To set RSI & STOH indicator top level)

Bot Buy: 31 (To set RSI & STOH indicator bottom level)

Files:
 

AND here is the EA. Please assit?

And THANK you in advance!

Just think if it can grow an account by 20% only buying, maybe 40% would be possible if we can get this thing to SELL as well ...

Files:
 
ForexID10T wrote >>

AND here is the EA. Please assit?

And THANK you in advance!

Just think if it can grow an account by 20% only buying, maybe 40% would be possible if we can get this thing to SELL as well ...

Hi, can not compile about this line:

Range = High - Low;

need to be something like

Range = High[1] - Low[1]; ?

 
EADeveloper wrote >>

Hi, can not compile about this line:

Range = High - Low;

need to be something like

Range = High[1] - Low[1]; ?

Thanks for this! When I compiled it did complain - I tried using [] and [0] but it still complained. In the end I just left it because the EA was running even with this "warning".

Do you perhaps know what does the following error mean?

'\end of program' - unbalanced left parenthesis

I know it means that somewhere I have a "(" too little or a ")" too many, but I just cannot find the error! I printed the document and crossed out each matching left "{" and right "}" and left "(" and right ")" - when all is done everything matches.

I have also seen if you double click on the error message the cursor jumps to the error inside the code - It lands on the last "}" of the BUY code - maybe the reason why the EA does not want "buy"?

Damn! I wish I was a real programmer instead of a Google "copy & paster"! Can you please assist?

And thank you for your trouble!

 
I changed the attached ForexkID10TuEA.mq4 High/Low to High[0]/Low[0] and it compiled just fine.
 
WHRoeder wrote >>
I changed the attached ForexkID10TuEA.mq4 High/Low to High[0]/Low[0] and it compiled just fine.

Thanks - Changed as you suggested - NO MORE warnings!

OK- I also found the extra "(" by comparing my previous code, line-by-line with the code that previously worked.

Here is the EA that is working again - hardcoded to use BULL_SCORE and BEAR_SCORE to trade.

A quick backtest shows the EA is now both BUYing and SELLing!

Obviously now the challenge is to find the balance between the scores to create profiable trades.

If you can find optimal stting before me, please let me know.

Files:
 
ForexID10T:

Thanks - Changed as you suggested - NO MORE warnings!

OK- I also found the extra "(" by comparing my previous code, line-by-line with the code that previously worked.

Here is the EA that is working again - hardcoded to use BULL_SCORE and BEAR_SCORE to trade.

A quick backtest shows the EA is now both BUYing and SELLing!

Obviously now the challenge is to find the balance between the scores to create profiable trades.

If you can find optimal stting before me, please let me know.

Hi ForexID10T,


I'm just a novice coder myself, and I am impressed with your brainwork to put this together. I tested the EA and it does both Buy/Sell trades, but I have not yet tested the various settings to find the best.


In the meantime, I looked at your code and have a question on one section for the ZigZag Trend -


Both the Bull and Bear code have the same ">" sign. Is this correct? Or should the Bear code have "<"?


//+------------------------------------------------------------------+
//Check if ZIGZAG TREND and set final MARKET_TREND for trading signal
if (ZIGZAG_SCORE_0 > 15) BULL_SCORE_0 = (BULL_SCORE_0 - 15);
* if (ZIGZAG_SCORE_0 > 15) BEAR_SCORE_0 = (BEAR_SCORE_0 - 15);


? * Should this line be "Less Than <":

if (ZIGZAG_SCORE_0 < 15) BEAR_SCORE_0 = (BEAR_SCORE_0 - 15);


if ((BULL_SCORE_0 > TARGET_SCORE) && (BULL_SCORE_0 > BEAR_SCORE_0)) {MARKET_TREND = "BULL_TREND";}

* if ((BEAR_SCORE_0 > TARGET_SCORE) && (BEAR_SCORE_0 > BULL_SCORE_0)) {MARKET_TREND = "BEAR_TREND";}


? * Should this line be "Less Than <":

if ((BEAR_SCORE_0 < TARGET_SCORE) && (BEAR_SCORE_0 < BULL_SCORE_0)) {MARKET_TREND = "BEAR_TREND";}


if (ZIGZAG_SCORE_0 > 15) {MARKET_TREND = "ZIGZAG_TREND";}

//+------------------------------------------------------------------+


As I said, I'm just a novice coder as well, so I may not understand this section too well. Thanks for sharing your EA. Your efforts are appreciated and I've learned some more reading your code.


Take care,
Robert

Reason: