stevehopwoodforex.com
https://www.stevehopwoodforex.com/phpBB3/
Print view

MACD Signal EA debugging
https://www.stevehopwoodforex.com/phpBB3/viewtopic.php?t=3953
Page 1 of 1
Author:  DoctorGremlin [ Mon Nov 24, 2014 3:35 pm ]
Post subject:  MACD Signal EA debugging

Hi Guys,

i am trying to build up an EA to trade the following conditions:

1. Trend Buy:
- Price > 240LWMA
At the Beginning of a new candle
- MACD 12,26,9 Mode Main < MACD 12,26,9 Mode Signal (Shift 2)
- MACD 12,26,9 Mode Main > MACD 12,26,9 Mode Signal (Shift 1)
- TP:50 pips, SL 50 pips, Breakeven 12, Breakevenprofit 3

2. Trend Sell:
- Price < 240LWMA
At the Beginning of a new candle
- MACD 12,26,9 Mode Main > MACD 12,26,9 Mode Signal (Shift 2)
- MACD 12,26,9 Mode Main < MACD 12,26,9 Mode Signal (Shift 1)
- TP:50 pips, SL 50 pips, Breakeven 12, Breakevenprofit 3

3. Countertrend Buy:
- Price < 240LWMA
At the Beginning of a new candle
- MACD 12,26,9 Mode Main < MACD 12,26,9 Mode Signal (Shift 2)
- MACD 12,26,9 Mode Main > MACD 12,26,9 Mode Signal (Shift 1)
- TP:25 pips, SL 25 pips, Breakeven 12, Breakevenprofit 3

4. Countertrend Sell:
- Price > 240LWMA
At the Beginning of a new candle
- MACD 12,26,9 Mode Main > MACD 12,26,9 Mode Signal (Shift 2)
- MACD 12,26,9 Mode Main < MACD 12,26,9 Mode Signal (Shift 1)
- TP:25 pips, SL 25 pips, Breakeven 12, Breakevenprofit 3

The following conditions should also be met:
-Different TP and SL settings for Trend and CT Trades
-Close on Opposite Signal and Open Trade in new Direction
-Only one trade at a time

Unfortunately, i am the biggest noob on earth when it comes to coding, so i tried it with some online generator (at least i tried first before crying for help :). It doesn't look to bad, but it has bugs or missing features which i can't solve. Those are the following:
-it doesn't open sells (which i don't understand)
- breakeven + profit is missing (i'm using MPTM instead)

It would be really great if someone could take a look at it and would fix the errors.

Greetz,
Doc
Author:  DoctorGremlin [ Thu Dec 18, 2014 12:46 pm ]
Post subject:  MACD Signal EA debugging

I have another question which i can't solve for myself.
I am searching for the syntax of the following:

if price hits a round number or sublevel (i.e. EURUSD 1.25000 or 1.24900, the last 2 digits are 0), then do something.

Since i can't code properly i need a bit of help with this "if-phrase".
All times are UTC Page 1 of 1