Par Sar EA Help

 

Hello all,

Scorpion, I want to thank you first for your awesome program-fisherman zerocode. I have no knowledge of coding but was really surprised at how easy you have made your code generator. It is really a great tool.

I have downloaded that program and been playing with it. I actually generated code for a simple system I have been using but still testing which is the Par Sar indicator method. I generated an EA using the Par Sar (0.10 , 0.20) but I noticed that It was only trading 1 currency at a time even when attached to about 4 curencies in the same time frame, it won't make another trade until the current trade as being exited.

I NEED HELP for you to check the code or tell me what to add so that it can trade multiple currencies in the same time frame at the same time and not just one currency at a time.

Also I will like the EA to be able to trade at specific time of the day for example 0.00gmt to 12.00gmt.

I'll be grateful if you or someone can help with this 2 modifications.

Thanks

Files:
psarea.mql  5 kb
 

I don't why my post wasn't posted correctly in this thread in the last two days.

Anyway, it's a limitation of zerocode actually. The produced experts can run only one pair. And to make matter worse, there's no easy workaround to this, sorry. When i finish ZeroCode for MetaTrader 4, everything will be much, MUCH, better. This limitation would be lifted.

Also I will like the EA to be able to trade at specific time of the day for example 0.00gmt to 12.00gmt.

Add these to buy & sell logics:

AND Hour >= 0

AND Hour < 12

If chart time is not GMT then you have to add/substract the numbers. E.g. Chart time is GMT+2, the logics would be Hour >= 2 AND Hour < 14.

 

Thank you Scorpion. I'll try that.

 

Hello Scorpion,

that logic works quite alright, but i noticed that after the specified time it just does not open a new trade neither does it close the current one.

So my question now is what do I need to do for it to close the trade at the specified time.

Example: EA logic is

AND Hour >= 0, AND Hour < 12

I want it to close of any current trade at exactly 12 GMT,

what logic should I apply?

Thanks for all your help on this forum.

 

Hi

Did you add previous logics to Buy and Sell only? Don't add them to Close Logics.

To close trade at 12:00 GMT, add to Close Logics:

AND Hour = 12

AND Minute >= 0

AND Minute <= 1

 

I actually added the previous logic only to Buy and Sell.

Now, I'll add the new one to Close Logic.

Thanks once again, I'll try that when market reopens tommorow sunday.

 

Hi Scorpion,

Everything working so far so good as I have requested and you have helped with the modifications.

However, I am thinking of a scenerio whereby I want the expert advisor to trade only ONCE and as soon as it hits TP or SL it no longer trades unless it is manually activated again, what code should I add.

Thanks

 

Heh will get back to you in an hour. Gotta go out for breakfast. (Is it night time overthere?)

 

yes it's 7:32 PM here Canada Mountain Time

 

Ok, i'm back.

Ok first, add below to buy logics: AND bIsBuying = False

Add to sell logics: AND bIsSelling = False

Compile to mql and open it.

Find line: var: cnt(0),IsBuying(False),IsSelling(False),IsClosing(False)

Below that, add var: bIsBuying(False), bIsSelling(False);

Find line: IsClosing = ....

Below that, add

if IsBuying then bIsBuying = true;
if IsSelling then bIsSelling = true;

That's it for the dirty hack.

 

Thanks a million!

I'll try that right away.