Need help debugging an EA

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

Need help debugging an EA

Post by DoctorGremlin »

Hi Guys,

i need some help debugging an EA which doesn't do what it should do :)
Don't hit me, i'm a noob creating EAs and tried creating this one on a Website (you will see this in the code).

What it should do:
if the last bar was bullish, open a sell on the open of the new candle, with an configurable TP and SL set to the high of the last bar. There should be only one trade per candle, exactly on the open of the new candle.
For a bearish candle it should be the exact opposite. if the EA is started in the middle of a candle, it should open the first trade on the new candle.

Problem:
it opens more than one trade per candle, and if the EA is activated in the middle of a candle, it instantly opens a trade.

I hope someone could help me with that.

Thanks,
Doc
You do not have the required permissions to view the files attached to this post.
Lowphat
Trader
Posts: 121
Joined: Fri Jun 27, 2014 12:20 am

Need help debugging an EA

Post by Lowphat »

untested
CounterBar 0.2.mq4
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

Need help debugging an EA

Post by DoctorGremlin »

Looks very good, thank you :yahoo:
DoctorGremlin
Trader
Posts: 50
Joined: Wed Oct 30, 2013 6:21 pm
Location: Frankfurt, Germany

Need help debugging an EA

Post by DoctorGremlin »

Lowphat,
could you insert the code so that the opened trade is closed on candle close?
Lowphat
Trader
Posts: 121
Joined: Fri Jun 27, 2014 12:20 am

Need help debugging an EA

Post by Lowphat »

untested
You do not have the required permissions to view the files attached to this post.
Post Reply

Return to “Coders Hangout”