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
5 registered members (Quad, AndrewAMD, Imhotep, TipmyPip, Edgar_Herrera), 809 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
bars built from ask prices, not last traded prices, in TRADE mod #471768
03/19/18 15:46
03/19/18 15:46
Joined: Oct 2017
Posts: 52
Brazil
J
jmlocatelli Offline OP
Junior Member
jmlocatelli  Offline OP
Junior Member
J

Joined: Oct 2017
Posts: 52
Brazil
I was comparing, in TRADE mode, the OHLC prices in Zorro with the same prices em MetaTrader and they are normally different. It seems the OHLC prices in Zorro came from ask prices and not from last traded prices. Is it the Zorro behavior?

att
jm

Re: bars built from ask prices, not last traded prices, in TRADE mod [Re: jmlocatelli] #471774
03/19/18 16:23
03/19/18 16:23
Joined: Jul 2017
Posts: 783
Z
Zheka Offline
User
Zheka  Offline
User
Z

Joined: Jul 2017
Posts: 783
Yes, Zorro uses Ask prices everywhere (while MT4 - mostly bid).

Re: bars built from ask prices, not last traded prices, in TRADE mod [Re: Zheka] #471778
03/19/18 17:09
03/19/18 17:09
Joined: Oct 2017
Posts: 52
Brazil
J
jmlocatelli Offline OP
Junior Member
jmlocatelli  Offline OP
Junior Member
J

Joined: Oct 2017
Posts: 52
Brazil
Tks for the help.
In Metatrader, the bars plotted in real time are formed from the real last traded prices. It can show the ask and bid price levels on the graphic window, but theses prices does not affect the bar. They are always the same during backtest, optimization or real trading.

Zorro in TRAIN or TEST mode, uses the OHLC prices from History or from Broker that corresponds to traded prices not to ask and bid prices. In TRADE mode it uses ask prices to form the bars and to trigger tick functions. Very different worlds for me.
I tried to trade and backtest the same strategy in the same period and the results are VERY different. Using TICKS and Period 1min.
Am I missing samething?

att
jm

Re: bars built from ask prices, not last traded prices, in TRADE mod [Re: jmlocatelli] #471806
03/20/18 09:12
03/20/18 09:12
Joined: Jul 2017
Posts: 783
Z
Zheka Offline
User
Zheka  Offline
User
Z

Joined: Jul 2017
Posts: 783
Quote:
In Metatrader, the bars plotted in real time are formed from the real last traded prices
In FX, this is most certainly not the case. Can you provide a link to a proof re MT?

Quote:
uses the OHLC prices from History or from Broker that corresponds to traded prices not to ask and bid prices
I suggest reviewing the *.mql file of Zorro's MT4 EA to see what kind of historical data Zorro actually requests from MT's servers.

I use bid-ask mid-point to feed into systems (just subtract 1/2 of Spread from the close) which makes it much more robust to occasional bid-ask spikes.

Last edited by Zheka; 03/20/18 09:18.
Re: bars built from ask prices, not last traded prices, in TRADE mod [Re: Zheka] #471835
03/21/18 14:32
03/21/18 14:32
Joined: Oct 2017
Posts: 52
Brazil
J
jmlocatelli Offline OP
Junior Member
jmlocatelli  Offline OP
Junior Member
J

Joined: Oct 2017
Posts: 52
Brazil
HI, tks for the reply and tips.
I do not trade FX. I currently trade futures.

In MT5, you can open the Depth of Market window and compare with the bars being plotted in the price graphic. MT5 plots the last deal price. I don't know if different brokers have different behaviors. I don't guess so.

As per your suggestion, I reviewed the Zorro's MT5 EA and the zmq4 include file. It really uses Ask and Bid prices:
#define Bid (::SymbolInfoDouble(_Symbol, ::SYMBOL_BID))
#define Ask (::SymbolInfoDouble(_Symbol, ::SYMBOL_ASK))
It seems Zorro EA never asks for SYMBOL_LAST.

Zorro EA requests OHLC prices as history data (CMD_HISTORY). That is not ask and bid prices. I have to double check with Download Zorro included strategy.

I confess I'm loosing enthusiasm with Zorro S.

att,
jm

Re: bars built from ask prices, not last traded prices, in TRADE mod [Re: jmlocatelli] #471841
03/21/18 15:50
03/21/18 15:50
Joined: Jul 2017
Posts: 783
Z
Zheka Offline
User
Zheka  Offline
User
Z

Joined: Jul 2017
Posts: 783
You can, in theory, change the mql file, request SYMBOL_LAST and transfer it to Zorro.
See for more details under "Zorro and the Brokers/MT4/5/Additional Data and Commands".

Out of curiosity: How often is the "trade" price different from either bid or ask? Does it happen at all?

Re: bars built from ask prices, not last traded prices, in TRADE mod [Re: Zheka] #471844
03/21/18 16:03
03/21/18 16:03
Joined: Oct 2017
Posts: 52
Brazil
J
jmlocatelli Offline OP
Junior Member
jmlocatelli  Offline OP
Junior Member
J

Joined: Oct 2017
Posts: 52
Brazil
I'll play with the mql file to see what happen. Have to find time.
I'll post the result.

It happens lots of time, specially during price congestion.
I'm trying to trade scalp so small differences matter for indicators calculation.
It really makes almost no difference en case of more long term trading, like swing or EOD trading.

I'm trying to minimize the impact with range bar.

Re: bars built from ask prices, not last traded prices, in TRADE mod [Re: jmlocatelli] #471846
03/21/18 16:06
03/21/18 16:06
Joined: Jul 2000
Posts: 27,977
Frankfurt
jcl Offline

Chief Engineer
jcl  Offline

Chief Engineer

Joined: Jul 2000
Posts: 27,977
Frankfurt
If you want to implement SYMBOL_LAST in mq5, make it switchable with the SET_PRICETYPE command. Otherwise you'll probably get garbage when you want to trade assets that have no last price.

Re: bars built from ask prices, not last traded prices, in TRADE mod [Re: jcl] #471850
03/21/18 16:12
03/21/18 16:12
Joined: Oct 2017
Posts: 52
Brazil
J
jmlocatelli Offline OP
Junior Member
jmlocatelli  Offline OP
Junior Member
J

Joined: Oct 2017
Posts: 52
Brazil
Hi jcl,
Tks for the tip.
According to doccumentatio, SET_PRICETYPE is not in the list of supported commands by MT4/MT5 plugin.
So, should also SET_PRICETYPE be implemented?

Re: bars built from ask prices, not last traded prices, in TRADE mod [Re: jmlocatelli] #471867
03/22/18 08:18
03/22/18 08:18
Joined: Jul 2000
Posts: 27,977
Frankfurt
jcl Offline

Chief Engineer
jcl  Offline

Chief Engineer

Joined: Jul 2000
Posts: 27,977
Frankfurt
Yes. For example, like this:

Code:
#define SET_PRICETYPE	151
uint g_PriceType = 0;
...

in the main switch/case: 

case SET_PRICETYPE:
	g_PriceType = (int)arr[1]; 
	arr[0] = 1; break;
...

and then:

#define Bid (::SymbolInfoDouble(_Symbol,g_PriceType == 2? ::SYMBOL_LAST : ::SYMBOL_BID))
etc.




Moderated by  Petra 

Powered by UBB.threads™ PHP Forum Software 7.7.1