I code your strategy into an EA

Moderator: moderators

farizu
rank: <50 posts
rank: <50 posts
Posts: 14
Joined: Mon Apr 13, 2009 8:18 pm
Reputation: 0
Gender: None specified

Postby farizu » Wed Jan 27, 2010 11:30 pm

Hi newschool,

I have been visually backtesting the ea that you kindly coded for me, and it has thrown up this rather major problem having to do with multiple order entries when the price whipsaws around the intertwined emas. Have a look at the attached picture.

One way to prevent this would be to code a condition that if a contrary signal is issued whilst one trade is still live, the live trade should be closed before the new signal is taken. That way at any given time only one trade would be active.

So for example if a short trade has triggered and then the price reverses shortly thereafter with the criteria being met for a long trade to be taken, then before the long trade is taken, the ea must first close out the short trade.

Is it possible for you to make this change to the ea?

Please add www.kreslik.com to your ad blocker white list.
Thank you for your support.

User avatar
newschool
rank: 150+ posts
rank: 150+ posts
Posts: 489
Joined: Fri Aug 21, 2009 2:26 am
Reputation: 1
Gender: Male

Postby newschool » Fri Jan 29, 2010 3:41 am

Done with few modifications. Check first page. It is starting to look good indeed.

farizu
rank: <50 posts
rank: <50 posts
Posts: 14
Joined: Mon Apr 13, 2009 8:18 pm
Reputation: 0
Gender: None specified

Postby farizu » Fri Jan 29, 2010 11:20 am

Many thanks newschool for the modified ea...will play around with it and report back...

In the meantime, can you please tell me how can i turn off the hedging function when running the ea?

farizu
rank: <50 posts
rank: <50 posts
Posts: 14
Joined: Mon Apr 13, 2009 8:18 pm
Reputation: 0
Gender: None specified

Postby farizu » Wed Feb 03, 2010 10:08 pm



Hi newschool, even with the new ea, i am still getting multiple orders...wondering why?

Have a look at the attached pic for more details

User avatar
newschool
rank: 150+ posts
rank: 150+ posts
Posts: 489
Joined: Fri Aug 21, 2009 2:26 am
Reputation: 1
Gender: Male

Postby newschool » Sat Feb 13, 2010 7:16 pm

Well hedging function will permit multiple orders... dont you check the inputs before running the EA ? Its all here..

Please add www.kreslik.com to your ad blocker white list.
Thank you for your support.

farizu
rank: <50 posts
rank: <50 posts
Posts: 14
Joined: Mon Apr 13, 2009 8:18 pm
Reputation: 0
Gender: None specified

Postby farizu » Sat Feb 13, 2010 7:40 pm

newschool wrote:Well hedging function will permit multiple orders... dont you check the inputs before running the EA ? Its all here..


The reason I asked is because the hedging input is a numerical value, and not a true or false input. So if I enter 0 next to hedging input, will it turn hedging off?

Also I am running into this error in back testing:


"farizu_EA: stopped due test limit "profit maximum=10000" reached with inputs: Lots=1..."

why has a profit maximum of $10000 been placed on the ea?

Many thanks for your ongoing help!

User avatar
newschool
rank: 150+ posts
rank: 150+ posts
Posts: 489
Joined: Fri Aug 21, 2009 2:26 am
Reputation: 1
Gender: Male

Postby newschool » Sat Feb 13, 2010 9:20 pm

-ohh small mistake, but you should be able to change it yourself in the code ;)
hint: double vs bool....

-turn the take profit to false...

farizu
rank: <50 posts
rank: <50 posts
Posts: 14
Joined: Mon Apr 13, 2009 8:18 pm
Reputation: 0
Gender: None specified

Postby farizu » Sat Feb 13, 2010 10:28 pm

newschool wrote:-ohh small mistake, but you should be able to change it yourself in the code ;)
hint: double vs bool....

-turn the take profit to false...


Thanks for that, will make the change.

Sorry to be thick, but about turning the hedge off, will entering 0 in the inputs turn the hedge off?

User avatar
newschool
rank: 150+ posts
rank: 150+ posts
Posts: 489
Joined: Fri Aug 21, 2009 2:26 am
Reputation: 1
Gender: Male

Postby newschool » Sat Feb 13, 2010 11:52 pm

hmm first you need to make the small change I talked about

then yes, boolean inputs accept both true/false and 1/0

PS: you shouldnt do forex on a saturdays night ;)

farizu
rank: <50 posts
rank: <50 posts
Posts: 14
Joined: Mon Apr 13, 2009 8:18 pm
Reputation: 0
Gender: None specified

Postby farizu » Sun Feb 14, 2010 12:14 am

newschool wrote:hmm first you need to make the small change I talked about

then yes, boolean inputs accept both true/false and 1/0

PS: you shouldnt do forex on a saturdays night ;)



:D well the only time i have to optimize this baby is on saturday nights!

Thanks again for your answers...this ea is looking pretty good on some of the back tests...

have you tried to optimise the settings at all?

Please add www.kreslik.com to your ad blocker white list.
Thank you for your support.


Return to “MetaTrader”