Gamestudio Links
Zorro Links
Newest Posts
Camera always moves upwards?
by clonman. 11/13/25 14:04
brokerCommand PLOT_HLINE parameters
by M_D. 11/13/25 10:42
ZorroGPT
by TipmyPip. 11/10/25 11:04
Training with the R bridge does not work
by frutza. 11/05/25 00:46
Zorro 2.70
by opm. 10/24/25 03:44
Alpaca Plugin v1.4.0
by TipmyPip. 10/20/25 18:04
AUM Magazine
Latest Screens
Rocker`s Revenge
Stug 3 Stormartillery
Iljuschin 2
Galactic Strike X
Who's Online Now
5 registered members (clonman, VoroneTZ, M_D, TipmyPip, AndrewAMD), 10,202 guests, and 3 spiders.
Key: Admin, Global Mod, Mod
Newest Members
sheliepaley, Blueguy, blobplayintennis, someone2, NotEBspark
19177 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
brokerCommand PLOT_HLINE parameters #488967
Yesterday at 20:28
Yesterday at 20:28
Joined: Apr 2020
Posts: 14
Germany
M
M_D Online OP
Newbie
M_D  Online OP
Newbie
M

Joined: Apr 2020
Posts: 14
Germany
Hi all,

need a hand regarding the brokerCommand PLOT_HLINE. Im using MT4 bridge and want to plot 2 pricelevels on mt4 chart.
manual says:

PLOT_HLINE | var[5] | Place a horizontal line at a given price in the chart window of the broker platform. 5 parameters are used: P[0] = always 0; P[1] = price position; P[2] = line color; P[3] = line width; P[4] = line style. Return the identfier number of the line.

so related part of my script looks like following:

Code
                BreakEvenLongTrigger = TradePriceOpen + Range * 0.5;
		LosingLongLevel = TradePriceOpen - Range * 0.4;

                brokerCommand(PLOT_HLINE,0,BreakEvenLongTrigger,GREEN,1,1);
		brokerCommand(PLOT_HLINE,0,LosingLongLevel,ORANGE,1,1);



those are placed within a tmf. if i try run with TRADE on mt4 demo account, zorro compiler gives following error:


brokerCommand(): wrong number of parameters
< brokerCommand(PLOT_HLINE,0,BreakEvenLongTrigger,GREEN,1,1);
>.

I could not find any further documentation or any examples on how the parameters have to be set. Any advice would be highly appreciated. (Zorro S 2.70)
rest of my script is running fine so far ...

Thanks in advance

M_D

Last edited by M_D; Yesterday at 20:34.
Re: brokerCommand PLOT_HLINE parameters [Re: M_D] #488968
Yesterday at 20:49
Yesterday at 20:49
Joined: Feb 2017
Posts: 1,809
Chicago
AndrewAMD Online
Serious User
AndrewAMD  Online
Serious User

Joined: Feb 2017
Posts: 1,809
Chicago
brokerCommand takes only two parameters. In your case:
brokerCommand (int Command, var* Parameters)

For PLOT_HLINE, it specifically says that the second parameter is var[5].

So in your script, you can do something like this:
Code
var hconfig[5];
hconfig[0] = 0; // always 0
hconfig[1] = 0; // price position
hconfig[2] = 0; // line color
hconfig[3] = 0; // line width
hconfig[4] = 0; // line style
brokerCommand(PLOT_HLINE, hconfig);

Re: brokerCommand PLOT_HLINE parameters [Re: M_D] #488969
Yesterday at 20:58
Yesterday at 20:58
Joined: Apr 2020
Posts: 14
Germany
M
M_D Online OP
Newbie
M_D  Online OP
Newbie
M

Joined: Apr 2020
Posts: 14
Germany
Hi AndrewAMD,

thank you. But new questions:
line color = ... like in zorro? GREEN?
line style = ... also no idea ... LINE?

Thanks in advance and kind regards

M_D

Re: brokerCommand PLOT_HLINE parameters [Re: M_D] #488970
Yesterday at 21:10
Yesterday at 21:10
Joined: Apr 2020
Posts: 14
Germany
M
M_D Online OP
Newbie
M_D  Online OP
Newbie
M

Joined: Apr 2020
Posts: 14
Germany
made the changes accordingly ...

Code
       var BreakEvenLongTrigger, LosingLongLevel;

       BreakEvenLongTrigger = TradePriceOpen + Range * 0.5;
       LosingLongLevel = TradePriceOpen - Range * 0.4;

        var hconfig_1[5];
	hconfig_1[0] = 0; // always 0
	hconfig_1[1] = BreakEvenLongTrigger; // price position
	hconfig_1[2] = GREEN; // line color
	hconfig_1[3] = 1; // line width
	hconfig_1[4] = LINE; // line style
	
	var hconfig_2[5];
	hconfig_2[0] = 0; // always 0
	hconfig_2[1] = LosingLongLevel; // price position
	hconfig_2[2] = ORANGE; // line color
	hconfig_2[3] = 1; // line width
	hconfig_2[4] = LINE; // line style

        brokerCommand(PLOT_HLINE, hconfig_1);
	brokerCommand(PLOT_HLINE, hconfig_2);


no compiler errors so far ... Thank you.
Testing now and will check if plots appear on mt4 chart ...

Re: brokerCommand PLOT_HLINE parameters [Re: M_D] #488971
4 hours ago
4 hours ago
Joined: Apr 2020
Posts: 14
Germany
M
M_D Online OP
Newbie
M_D  Online OP
Newbie
M

Joined: Apr 2020
Posts: 14
Germany
Well, script is running without errors. But dont get plots on mt4 chart.
Can someone tell me how to return a brokercommand value (check if !=0)?
on the mt4 terminal there are no related messages in Experts or Journal tab.

Zorro manual "MT4/5 Bridge" gives advise on how to get a return, i have read it ... but not really understood. And seems to me like explaination for "own generated broker commands".
Not my case, already predefined. so how to proceed?


Moderated by  Petra 

Gamestudio download | Zorro platform | shop | Data Protection Policy

oP group Germany GmbH | Birkenstr. 25-27 | 63549 Ronneburg / Germany | info (at) opgroup.de

Powered by UBB.threads™ PHP Forum Software 7.7.1