MACD Signal EA debugging

Post Reply
DoctorGremlin
Trader
Posts: 50
Joined: Wed Oct 30, 2013 6:21 pm
Location: Frankfurt, Germany

MACD Signal EA debugging

Post by DoctorGremlin »

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
You do not have the required permissions to view the files attached to this post.
DoctorGremlin
Trader
Posts: 50
Joined: Wed Oct 30, 2013 6:21 pm
Location: Frankfurt, Germany

MACD Signal EA debugging

Post by DoctorGremlin »

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".
Post Reply

Return to “Coders Hangout”