Gamestudio Links
Zorro Links
Newest Posts
Blobsculptor tools and objects download here
by NeoDumont. 03/28/24 03:01
Issue with Multi-Core WFO Training
by aliswee. 03/24/24 20:20
Why Zorro supports up to 72 cores?
by Edgar_Herrera. 03/23/24 21:41
Zorro Trader GPT
by TipmyPip. 03/06/24 09:27
VSCode instead of SED
by 3run. 03/01/24 19:06
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
2 registered members (Imhotep, opm), 785 guests, and 4 spiders.
Key: Admin, Global Mod, Mod
Newest Members
sakolin, rajesh7827, juergen_wue, NITRO_FOREVER, jack0roses
19043 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
MT4 Binary Options Trading #462097
09/09/16 08:12
09/09/16 08:12
Joined: Oct 2012
Posts: 16
Western Australia
4xBones Offline OP
Newbie
4xBones  Offline OP
Newbie

Joined: Oct 2012
Posts: 16
Western Australia
I'm pretty new to this coding game (being saying that for a while now!), and am having problems getting a binary options strategy to work using the MT4 bridge. Trading on a demo account (not live yet), to experiment I used the example from Binary Options: Scam or Opportunity , and modified the code as follows:

Code:
///////////////////////////////////////////////////////
// Binary trading system //////////////////////////////
///////////////////////////////////////////////////////

var objective()
{
	return ((var)(NumWinLong+NumWinShort))/(NumLossLong+NumLossShort);
}

function run()
{
	
	set(PARAMETERS|LOGFILE);
	BarPeriod = 5;
	LookBack = 100;
	NumWFOCycles = 20;
	NumCores = -2;
	PlotHeight1 = 340;
	PlotWidth = 800;
	
	set(BINARY);
	WinPayout = 80;
	LossPayout = 0;
	
	//
	//set up trades
	//
	LifeTime = 1;
	int Size = 5; //order size in $
	int TimePeriod = optimize(45,10,100);
	var Threshold = 0.1*(HH(TimePeriod)-LL(TimePeriod));

	if(NumOpenLong+NumOpenShort == 0) 
	{
		if((HH(TimePeriod) - priceClose()) < Threshold)
			{
				//enterShort();
				brokerCommand(SET_ORDERTEXT,"BO exp:300");
				enterShort(Size);
			}
		if((priceClose() - LL(TimePeriod)) < Threshold)
			{
				//enterLong();
				brokerCommand(SET_ORDERTEXT,"BO exp:300");
				enterLong(Size);
			}
	}
}



The strategy Trains, and Tests fine, but when Trading the system, it connects but hangs (infinite loop) after the "loading prices..." line, with the log as follows:

Quote:
Binary_Q
Login MT4...
!Go Markets Pty Ltd connected
!MT4 time zone shift -3 at UTC 09.09. 07:50
Loading EUR/JPY prices.. 300 min, 500 bars added


I'm trading with Go Markets, and broker's symbol is "EURJPY.bo" in this case. Can anyone help?

Re: MT4 Binary Options Trading [Re: 4xBones] #462102
09/09/16 12:48
09/09/16 12:48
Joined: Jul 2000
Posts: 27,977
Frankfurt
jcl Offline

Chief Engineer
jcl  Offline

Chief Engineer

Joined: Jul 2000
Posts: 27,977
Frankfurt
I don't think that you can use brokerCommand(SET_ORDERTEXT) unless you have the beta version. The "hanging" is probably caused by sending an unknown command to MT4.

Re: MT4 Binary Options Trading [Re: jcl] #462105
09/09/16 14:59
09/09/16 14:59
Joined: Oct 2012
Posts: 16
Western Australia
4xBones Offline OP
Newbie
4xBones  Offline OP
Newbie

Joined: Oct 2012
Posts: 16
Western Australia
Yes, you're correct. Was using Zorro S 1.47, have just downloaded and installed 1.50, and now works fine.

Thanks smile

Re: MT4 Binary Options Trading [Re: 4xBones] #462985
11/09/16 18:51
11/09/16 18:51
Joined: Nov 2016
Posts: 4
A
ayke090 Offline
Guest
ayke090  Offline
Guest
A

Joined: Nov 2016
Posts: 4
Hi i can`t figure why i recieve
Zorro error :

[EUR/USD::S)17:12 Can`t open 100@1.0945

Metatrader error:

Open EUR/USDbo 100@1.0945 stop 0 slp5 magic 42379
Order Failed - trade is disable

Auto trading in mt4 is enable.

Re: MT4 Binary Options Trading [Re: ayke090] #462991
11/10/16 01:15
11/10/16 01:15
Joined: Oct 2012
Posts: 16
Western Australia
4xBones Offline OP
Newbie
4xBones  Offline OP
Newbie

Joined: Oct 2012
Posts: 16
Western Australia
Originally Posted By: ayke090
Hi i can`t figure why i recieve
Zorro error :

[EUR/USD::S)17:12 Can`t open 100@1.0945

Metatrader error:

Open EUR/USDbo 100@1.0945 stop 0 slp5 magic 42379
Order Failed - trade is disable

Auto trading in mt4 is enable.


Without seeing your code, my first guess would be to check your order size. 100 may be too large for your broker?

Edit: Another thing I've noticed is there doesn't seem to be an order direction, long or short?

Last edited by 4xBones; 11/10/16 06:57.
Re: MT4 Binary Options Trading [Re: 4xBones] #462997
11/10/16 10:57
11/10/16 10:57
Joined: Nov 2016
Posts: 4
A
ayke090 Offline
Guest
ayke090  Offline
Guest
A

Joined: Nov 2016
Posts: 4
The code is this from you`r post , [EUR/USD::S] it`s a short , the size is not the problem , i tried again today the same thing.
Could be a broker restriction? i use solidary markets

I tried with GoMarkets, the same problem


Trade: KKT EUR/USD 10.11.2016
Error 062: Can't open KKT_EURUSD.par (rt:2)
Lookback period (100 bars) .

[317: Thu 10.11.16 14:56] (1.08695).
(EUR/USD::L) 14:56 Can't open 5@1.0872

[318: Thu 10.11.16 14:57] (1.08716)
[319: Thu 10.11.16 14:58] (1.08748)
Session stopped at 14:58
Logout.. ok


mt4 message :####'2000094040': order sell market 25.00 EURUSD.bo sl: 0.00000 tp: 0.00000

#################'2000094040': order sell 25.00 EURUSD.bo opening at market sl: 0.00000 tp: 0.00000 failed [Trade is disabled]

Last edited by ayke090; 11/10/16 15:30.
Re: MT4 Binary Options Trading [Re: ayke090] #463010
11/10/16 15:21
11/10/16 15:21
Joined: Oct 2012
Posts: 16
Western Australia
4xBones Offline OP
Newbie
4xBones  Offline OP
Newbie

Joined: Oct 2012
Posts: 16
Western Australia
The code above works fine on Go Markets, as that's who I am using. (must be used on demo accounts only, as it is not really profitable)

1) Make sure you're using latest version of Zorro (at least version 1.50)

2) If not Go Markets, then make sure the broker allows EA trading for binary options (BO).

3) If Go Markets, then broker needs to enable binary options trading on your account. You will need to contact their support for this.

4) Check your time frame, most brokers (maybe all of them?) don't allow BO EA trading on time frames below 5 minutes.

Re: MT4 Binary Options Trading [Re: 4xBones] #463011
11/10/16 15:36
11/10/16 15:36
Joined: Nov 2016
Posts: 4
A
ayke090 Offline
Guest
ayke090  Offline
Guest
A

Joined: Nov 2016
Posts: 4
1. I have 1.50
2. On GoMarkets the same error
3. I have instaled the FxLite plugin
4. TF 5m

I try to use this on demo acc , for testing to see how it works.

On EUR/USD forex opens , but on EUR/USDbo not

Last edited by ayke090; 11/10/16 15:40.
Re: MT4 Binary Options Trading [Re: ayke090] #463026
11/11/16 04:15
11/11/16 04:15
Joined: Oct 2012
Posts: 16
Western Australia
4xBones Offline OP
Newbie
4xBones  Offline OP
Newbie

Joined: Oct 2012
Posts: 16
Western Australia
Originally Posted By: ayke090
1. I have 1.50
2. On GoMarkets the same error
3. I have instaled the FxLite plugin
4. TF 5m

I try to use this on demo acc , for testing to see how it works.

On EUR/USD forex opens , but on EUR/USDbo not


Have you updated the MT4 "Experts" and "Libraries" files that came with the latest Zorro version?

Last edited by 4xBones; 11/11/16 04:16.

Moderated by  Petra 

Powered by UBB.threads™ PHP Forum Software 7.7.1