Forex Factory (https://www.forexfactory.com/forum.php)
-   Trading Systems (https://www.forexfactory.com/forumdisplay.php?f=71)
-   -   My "Ultron" EA for GBPUSD H1 timeframe (https://www.forexfactory.com/showthread.php?t=840339)

robots4me Nov 13, 2018 5:59am | Post# 241

GMT+0 versus GMT+2

In an earlier post I attempted to answer a question about GMT+0 versus GMT+2. This issue concerns your broker's time and has nothing to do with your local time. The Ultron EA uses 'hour1' and 'hour2' settings -- which refer to GMT+2, since that is what @Pawel's broker uses. @Pawel feels these settings do make a difference and that is why he included them. I use both GMT+0 and GMT+2 brokers, so I decided to pay attention to these settings. If your broker uses GMT+2 then you can continue to use the defaults that @Pawel recommends -- hour1=6, and hour2=21. If your broker uses GMT+0 then you might choose to change them. In my earlier post I said you would need to add 2 hours to convert from GMT+2 to GMT+0 -- but that is wrong. You need to subtract 2 hours. I apologize for the misinformation. Here's a link:
http://www.timebie.com/tz/timediff.p...MT%20+2%20Time

robots4me Nov 13, 2018 6:15am | Post# 242

GMT+0 versus GMT+2 (continued)

Since I use both GMT+0 and GMT+2 brokers then I wanted the EA to automatically do the right thing and adjust the 'hour1' and 'hour2' settings accordingly. That is, I wanted the EA to determine whether the broker is GMT+2 (in which case no change is needed) or GMT+0 (in which case 2 hours should be subtracted).

Below is a code snippet I wrote that seems to work and achieve that goal -- feel free to add it to your *.mq4 code. Or, perhaps @Pawel would consider including something like this in his next version -- I don't know. Or, maybe @Pawel would prefer to keep his Ultron EA simple, lean and mean and not clutter it with non-essential code.

By the way -- the original formatting of the code was easier to read. However, when I add code to a post then, for some reason, ForexFactory automatically reformats it and removes spaces -- probably to conserve space.

##################################################################

// According to @Pawel, Ultron's Hour1 and Hour2 are based on his broker's server using GMT+2,
// so let's honor that.
int iGMTOffset = GMT_GetBrokerOffset();
if (2 == iGMTOffset)
{
// This is the case for GMT+2
// Nothing to do -- same as @Pawel...
}
else
{
// This is the case for GMT+0 and GMT+1
if ((2 - iGMTOffset) > 0)
{
Hour1 -= (2 - iGMTOffset);
Hour2 -= (2 - iGMTOffset);
if (Hour1 < 1)
Hour1 = 1;
}
}


//+------------------------------------------------------------------+
//| |
//+------------------------------------------------------------------+
int GMT_GetBrokerOffset()
{
int AccuracyThresholdInMinutes = 60;

datetime datGMT = TimeGMT();
datetime datBrokerGMT = TimeCurrent();
double dDelta = (double)(datBrokerGMT - datGMT);
dDelta = MathRound(dDelta / (AccuracyThresholdInMinutes * 60));

return ((int)dDelta);
}

pipsy7 Nov 13, 2018 9:35am | Post# 243

"would prefer to keep his Ultron EA simple, lean and mean and not clutter it with non-essential code." = thats d Way 2 go m8 4sure !

mrdfx Nov 13, 2018 11:21am | Post# 244

1 Attachment(s)
Today there was a trade opened by ULTRON and hit TP.
Click to Enlarge

Name: Screen Shot 2018-11-13 at 14.20.43.png
Size: 200 KB

Pawel.Gawron Nov 13, 2018 11:27am | Post# 245

1 Attachment(s)
Today there was a trade opened by ULTRON and hit TP. {image}
Can confirm

Click to Enlarge

Name: tron.png
Size: 63 KB

Ansab001 Nov 13, 2018 11:36am | Post# 246

Damn it I set itit up on my gmt broker not my gmt+2. Oh well I'llI'll get it sorted for next one

pipsy7 Nov 13, 2018 11:41am | Post# 247

1 Attachment(s)
Dzięki Pawel, moja żona pochodzi z Samborowa
Click to Enlarge

Name: gu.png
Size: 53 KB

Pawel.Gawron Nov 13, 2018 11:49am | Post# 248

Dzięki Pawel, moja żona pochodzi z Samborowa {image}
Cała przyjemność po mojej stronie, wszystkiego dobrego!

Feex Nov 13, 2018 12:12pm | Post# 249

3 Attachment(s)
It was possible to implement the correct trailing stop)
In this modification EA has implemented a trailing stop, which can not affect profits negatively!
The trailing stop starts working only when the price has crossed the TP level.
In the worst case, the order will close on TP. In the best case TR will collect additional profits.
Also added information panel.
EA's algorithm has not changed
ULTRON-3.1.7-TR.ex4
Click to Enlarge

Name: ULTRON_3.1.7-TR_mod_FY.jpg
Size: 189 KB
Click to Enlarge

Name: ULTRON_3.1.7-TR_mod_SET_.JPG
Size: 69 KB

Feex Nov 13, 2018 12:29pm | Post# 250

2 Attachment(s)
The first test without TR
Click to Enlarge

Name: ULTRON_3.1.7-TR_test_standart.jpg
Size: 137 KB
Second with TR
Click to Enlarge

Name: ULTRON_3.1.7-TR_test_TR.jpg
Size: 138 KB

Ansab001 Nov 13, 2018 12:29pm | Post# 251

1 Attachment(s)
Guys i got this error message.

Is this due to the Time difference?
Click to Enlarge

Name: Screenshot1.png
Size: 138 KB

Pawel.Gawron Nov 13, 2018 12:41pm | Post# 252

Guys i got this error message. Is this due to the Time difference? {image}
the code you are using has some operation that divides by zero - as far as I can tell you from this message.

Ansab001 Nov 13, 2018 12:50pm | Post# 253

{quote} the code you are using has some operation that divides by zero - as far as I can tell you from this message.
hmmm ok, i will download your version on post1, i am using my gmt+2 broker..Iwont do anyhting to the file just upload and arrange pip size. Hopefully no issue

pipsy7 Nov 13, 2018 1:02pm | Post# 254

.Iwont do anyhting to the file just upload and arrange pip size = good idea + use H1 tf - - - pic whut u posted was on Daily !

______________better still "read + study post#1 more carefull m8 "

Ansab001 Nov 13, 2018 1:09pm | Post# 255

.Iwont do anyhting to the file just upload and arrange pip size = good idea + use H1 tf - - - pic whut u posted was on Daily ! ______________better still "read + study post#1 more carefull m8 "

Thanks mate...Maybe i should have your siggy with the silly mistakes im making!

Anyway. I have opened a second account on my gmt+" broker.

100GBP test is to see how it does from Mid Nov - End of December.

I am expecting a max of 8- 15 trades. I would like to continue the test untill it has done 100 trades...if possible.

I put a diary here whenever I can.

driven18 Nov 13, 2018 2:18pm | Post# 256

I think that this EA in reality needs to be tested with only 0.3 lots which is 2% per $10,0000 of equity. Therefore profit and losses will be 1/3 of what you getting right now.
We are testing and trading now with 1 lot per $10,000 which is 6.5% risk per trade. That is huge risk and not many traders will be able to handle few losses in a row this size of position. 33% DD is a huge hole in real money.

So I suggest when looking at performance to use 0.3 pr $10,0000. Anyone does not have that concern?

Feex Nov 13, 2018 2:36pm | Post# 257

where did you get 33%?
if on my screenshots, then I tested EA with an initial deposit of only 3000, and lot 1.0. This gives 33% and with a TR of 31% If the deposit is 10,000 and lot 1.0 then you get about a 20% drawdown. Personally, I'm quite happy with the 1.0 lot and the initial deposit of 3000

pipsy7 Nov 13, 2018 2:46pm | Post# 258

1 Attachment(s)
Pawel ist usin 0.01 lot = post#245 - - - i use 0.03 lot on Live Micro acct. = dont Blieve in demo or BT etc2
Click to Enlarge

Name: gu1.png
Size: 4 KB

driven18 Nov 13, 2018 2:48pm | Post# 259

Hmm..you got 32% in maximum DD

Not sure how you got $19,000 in profit(chistaya pribil) ..it is 600% on your initial capital....

I think your leverage is different, here(tyt) in USA it is 50:1 max

Feex Nov 13, 2018 3:05pm | Post# 260

Hmm..you got 32% in maximum DD Not sure how you got $19,000 in profit(chistaya pribil) ..it is 600% on your initial capital.... I think your leverage is different, here(tyt) in USA it is 50:1 max
no luck to you ... I use 1: 500


© Forex Factory