Help

 
 

hi teres,

i cannot help you code this strategy...because i cannot code myself. but i'll say this...from my experience..your strategy will not be very profitable because your stop loss(300 pip) is six times bigger than your limit order. this is not a good thing to do.

As for coding this strategy...codersguru will be here shortly and mayb he can help you. that guy is a MT4 coding GURU.

regards

gabroo

 

Hi

Thanks for answear....

Please code Guru for help....

I try to calculate ...this strategy for 2 months...backtested in SPSS and it get about 33x50 and -58-80-125-151-176= 1060 PIP!!!

It seem to be good. There is one more important think to compile.... for 2 months there were no stop loss happend.

Regards Teres

 

I found something inside my computer. I do not know about the time but I think it is very similar with your idea.

Files:
 

Thanks

Hallo

Thank you very much....

This i exactly what I tried to copy and compiled with my strategy...it is similar...

But could you help me construct one method like this but which start at exact time? 5:02 PM time zone New York? This it the main breakpoint...

And when you calculate by hand....it seem to be more profitable.....another way and I can learn how to construkt my own strategy.

Thanks

Regards Teres

 
Teres:
Hallo

Thank you very much....

This i exactly what I tried to copy and compiled with my strategy...it is similar...

But could you help me construct one method like this but which start at exact time? 5:02 PM time zone New York? This it the main breakpoint...

And when you calculate by hand....it seem to be more profitable.....another way and I can learn how to construkt my own strategy.

Thanks

Regards Teres

Teres,

I studed the coding together with Codersguru lessons so may be, I did some mistake. So you must check everything that I posted below.

It should not be NY time. It should be your server's time (Metatrader's time). Just re-calculate the time acording to your Metatrader.

As I know it may be the following code in the beginning in the place where the settings are located:

extern bool UseHourTrade = True; //Use time to trade (from ... to ...)

extern int FromHourTrade = 0; // Time to start trading

extern int ToHourTrade = 23; // Time to finish

extern int HourOpen = 7; // Exact hour to open the order

extern int MinuteOpen = 0; //exact minutes to open the order[/CODE]

And after that you may use the following (as example):

int start(){

for (int i=0; i<OrdersTotal(); i++) {

if (OrderSelect(i, SELECT_BY_POS, MODE_TRADES)) {

TrailingPositions();

}

}

if (UseHourTrade){

if (!(Hour()>=FromHourTrade && Hour()<=ToHourTrade)) {

Comment("Not time to trade!");

return(0);

}

}

if(Bars<100){

Print("bars less than 100");

return(0);

}

if (prevCountBars != Bars && prevCountBars !=0 && !ExistPositions()) {

if(AccountFreeMargin()<(1000*Lots)){

Print("no money available. Free Margin = ", AccountFreeMargin());

return(0);

}

if ((Hour()==HourOpen && Minute()>=MinuteOpen)){

OpenBuy();

Sleep(3000);

OpenSell();

return(0);

}

}[/CODE]

If you want to open the order exact at the time you estimated you may change this one:

if ((Hour()==HourOpen && Minute()>=MinuteOpen))[/CODE]

on to that one:

if ((Hour()==HourOpen && Minute()==MinuteOpen))[/CODE]

But in this case you must be sure that the price is crossing the MA exact at the time. Otherwise you need to change something inside the EA also because the EA I posted above is trading when the price is crossing the MA but as I understand you need the price to be above or below MA at the time you estimated.

In the EA I posted the sell condition is the following:

[CODE]//---- sell conditions

if(Open[1]>ma && Close[1]<ma)

And buy condition:

[CODE]//---- buy conditions

if(Open[1]ma)

So it works on the price-ma crossing. But as I understand you need the price above or below so use just

[CODE]Close [1]<ma

only for example for sell or something else (I do not know).

You also mentioned that you need for everything to be in opened bar (zero bar) because you are using D1 timeframe. In this case it may be for sell:

[CODE]Open[0]<ma;

Sorry I can not help you a lot because I am studying Codersguru lessons together with everybody and may be I did mistake somewhere. I think Codersguru may check it because he is more professional with this subject.

Just try, open the EA I posted above this post and change everything. And may be it will work.

 

Besides you may use templates to create EA https://www.mql5.com/en/forum/173059

I used it.

 
newdigital:
I do not know (do not care). This EMA-above/below-NY time is her strategy (not mine). She asked for help and sent two PMs to me so I just did what I could. That's all.

Which service?

I am not starting anything behind this forum.

LOL I am not asking you newdigital. The question is for Teres herself. Sorry for the misunderstanding

 

By the way, is this Teres from Teres-Forex http://www.[something].cz/forexcz/ since you got the same strategy. I thought you already start your signaling service ?

 
firedave:
By the way, is this Teres from Teres-Forex http://www.[something].cz/forexcz/ since you got the same strategy. I thought you already start your signaling service ?

I do not know (do not care). This EMA-above/below-NY time is her strategy (not mine). She asked for help and sent two PMs to me so I just did what I could. That's all.

I thought you already start your signaling service ?

Which service?

I am not starting anything behind this forum.

Not yet

 

Hallo

Thak you very very much.... it is so long, that I have this weekend to study this script!!!! THanks a lot to newdigital.

To firedave my strategy on my site, do you reall y think,that I sent here the all my secrets????? sorry but this is far a way of ma strategy..........

bu good Idea, what do you think??? Can you also help with??? or .....

Regards Teres

Reason: