Gamestudio Links
Zorro Links
Newest Posts
Help with plotting multiple ZigZag
by degenerate_762. 04/30/24 23:23
M1 Oversampling
by 11honza11. 04/30/24 08:16
Trading Journey
by howardR. 04/28/24 09:55
Zorro Trader GPT
by TipmyPip. 04/27/24 13:50
Data from CSV not parsed correctly
by jcl. 04/26/24 11:18
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
2 registered members (AndrewAMD, SBGuy), 987 guests, and 3 spiders.
Key: Admin, Global Mod, Mod
Newest Members
firatv, wandaluciaia, Mega_Rod, EternallyCurious, howardR
19050 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Page 4 of 4 1 2 3 4
Re: Micro lot trading [Re: dusktrader] #426227
07/18/13 11:13
07/18/13 11:13
Joined: Jul 2013
Posts: 522
D
dusktrader Offline
User
dusktrader  Offline
User
D

Joined: Jul 2013
Posts: 522
Sorry to beat a dead horse. I'm still experimenting with this, to find the best (or most correct) setting for my (apparently nano) IBFX account:

I am currently swapping back and forth between 2 different Assets.dta files. One is directly from the broker via Download script. This one lists the assets apparently in nano lots, which we know is confusing to Zorro due to the issues mentioned above.

One workaround I like is to force in the Zorro.mq4 script:
Code:
double LotFactor = 0.1;


which (I think) forces Zorro to essentially take 10x the trade lot size (ie 10 nano lots = 1 micro lot I believe... so 10 cents instead of 1 cent).

The other workaround discussed above is to modify Zorro scripts by forcing more lots, such as "Lots = 10".

At first glance, you would think these 2 workarounds should have the same effect. But in trying to figure out why the test results were sometimes very different, I came across this:

Here is a snippet from Assets.dta when I let it pull the ACTUAL nano account info from broker:
Code:
Name     Price   Spread  RollLong/Short PIP PIPCost Margin Lot
AUDCAD  0.94132 0.00037 0.4620 -0.5840 0.0001 0.0096 1.81 100.0
AUDCHF  0.85840 0.00037 0.7020 -0.9270 0.0001 0.0106 1.81 100.0



And now look at the same snippet when I've forced the Lots x10 in the Zorro.mq4 script:
Code:
Name     Price   Spread  RollLong/Short PIP PIPCost Margin Lot
AUDCAD  0.95670 0.00039 0.4620 -0.5840 0.0001 0.0961 18.37 1000.0
AUDCHF  0.86642 0.00037 0.7020 -0.9270 0.0001 0.1061 18.37 1000.0



The difference, I believe, are caused from the rounding in PIPCost. Too much value is lost if you start with a rounded value (nano) and multiply to increase the size. Seems more accurate to do it the other way.

In thinking about this, it seems to make sense. In fact, philosophically, it seems like a bad idea in general to test with bare-minimum lot size if rounding would be an issue. For example on spreads and rollover, etc, broker is always going to round up to the next penny. If you're only trading pennies to begin with, then your results could be way off. Half a penny could represent 50% difference lol.

So my (long winded) argument here is that... for testing (and trading), that nano lot accounts should not be sliced-and-diced all the way to the penny level. It is not too optimistic to increase lots flatly by a factor such as I have done. Rather, it is helpful because it allows more accuracy in testing with less rounding. (Please argue otherwise if you don't agree)

THANKS

Re: Micro lot trading [Re: dusktrader] #426236
07/18/13 12:35
07/18/13 12:35
Joined: Jul 2000
Posts: 27,986
Frankfurt
jcl Offline

Chief Engineer
jcl  Offline

Chief Engineer

Joined: Jul 2000
Posts: 27,986
Frankfurt
It is better to increase the number of lots in the script.

If you increase it in the account parameters, you end up with wrong parameters. If you then trade the system live, a given margin setting will open ten times more lots than it should, and thus trade ten times more risky.

Re: Micro lot trading [Re: jcl] #426239
07/18/13 12:49
07/18/13 12:49
Joined: Jul 2013
Posts: 522
D
dusktrader Offline
User
dusktrader  Offline
User
D

Joined: Jul 2013
Posts: 522
I agree, with regard to actual trading... but for the purpose of having accurate testing... how can I resolve the issue of the PIPCost being rounded?

In the example above the PIPCost is 0.0961 --> 0.0096 but I have seen others that are much worse, for example what if it was 0.0964 --> 0.0096 ? That seems too inaccurate doesn't it?

Do you know if I can just manually tweak Asset.dta to have a 5-digit precision? That way I could get the best of both worlds. So in other words, keep the correct Asset.dta nano lot settings, but provide the 5th decimal like this: 0.00961

If you're not sure, I can just try it and report back. THANKS

Re: Micro lot trading [Re: dusktrader] #426242
07/18/13 13:10
07/18/13 13:10
Joined: Jul 2000
Posts: 27,986
Frankfurt
jcl Offline

Chief Engineer
jcl  Offline

Chief Engineer

Joined: Jul 2000
Posts: 27,986
Frankfurt
You can manually tweak Assets.dta by just editing it and entering the higher precision number. Nano accounts need 5 or 6 digits precision for PIPCost. We'll change that in the next version.

Re: Micro lot trading [Re: jcl] #426246
07/18/13 13:50
07/18/13 13:50
Joined: Jul 2013
Posts: 522
D
dusktrader Offline
User
dusktrader  Offline
User
D

Joined: Jul 2013
Posts: 522
Awesome... thanks laugh

I noticed that the precision doesn't make much difference for major pairs like those included by default with Zorro. However, for some exotic crosses it does seem to make a difference.

Also, I noticed that Zorro (or perhaps the broker?) seems to not be rounding correctly when producing the PIPCost in Assets.dta. It seems to be just truncating the decimal places.

An example is this:
When I download IBFX assets by forcing LotFactor = 0.1:
Code:
EURNZD  1.66161 0.00048 -0.8970 0.6900 0.0001 0.0789 26.22 1000.0



But when I download IBFX with its correct LotFactor of 0.01:
Code:
EURNZD  1.67708 0.00060 -0.8970 0.6900 0.0001 0.0078 2.61 100.0



So I would prefer to see 0.00789 (or even more precision), or at the very least it should be rounded to 0.0079

Please check other critical figures also for rounding issues, in case you find that this is a Zorro issue.
THANKS

Re: Micro lot trading [Re: dusktrader] #426250
07/18/13 14:56
07/18/13 14:56
Joined: Jul 2013
Posts: 522
D
dusktrader Offline
User
dusktrader  Offline
User
D

Joined: Jul 2013
Posts: 522
I'm attaching here the Assets.dta file that I've tweaked for US-based IBFX mini* accounts. I carried the precision to 2 more decimal places in both the PIPCost and Margin columns, based on information from the actual broker (via Download.c script)

I believe this has improved my testing accuracy slightly. If you agree this is all setup correctly, feel free to include it with a future Zorro release to help other US-based IBFX traders.

*NOTE: IBFX only offers "Standard" and "Mini" accounts. The account called "mini" is actually a micro account, allowing nano lots of 0.01 (ie, 1 cent)

Attached Files
Last edited by dusktrader; 07/18/13 15:00.
Re: Micro lot trading [Re: dusktrader] #426281
07/19/13 09:36
07/19/13 09:36
Joined: Jul 2000
Posts: 27,986
Frankfurt
jcl Offline

Chief Engineer
jcl  Offline

Chief Engineer

Joined: Jul 2000
Posts: 27,986
Frankfurt
The next Zorro version will store PIPCost with higher precision.

Computer languages don't round numbers when they store them in text files. Although this could theoretically be implemented with special functions, increasing the precision is normally the better way.

Re: Micro lot trading [Re: jcl] #428905
09/05/13 12:44
09/05/13 12:44
Joined: Jul 2013
Posts: 522
D
dusktrader Offline
User
dusktrader  Offline
User
D

Joined: Jul 2013
Posts: 522
Hello, once again I must apologize for digging up this dead horse thread... but I've only just realized today that something has changed regarding Assets.dta (I'm currently on v1.14)

The Assets.dta that I prefer came from my IBFX broker and is 2 posts above this one.

However, in the current Zorro version it seems that as soon as I run a backtest, Zorro modifies Assets.dta. It seems to reduce precision and also round-up both the PIPcost and Margin column.

I'm ok with this, as long as you can assure me that rounding-up is always the preferred pessimistic choice. If it could introduce too much optimism then that would be a problem I think. Here is an example:

original Asset.dta
Quote:
Name Price Spread RollLong/Short PIP PIPCost Margin Lot
AUDCAD 0.95386 0.00036 0.4620 -0.5840 0.0001 0.009608 1.8310 100.0
AUDCHF 0.86695 0.00038 0.7020 -0.9270 0.0001 0.010571 1.8310 100.0


modified by Zorro after first backtest
Quote:
Name Price Spread RollLong/Short PIP PIPCost Margin Lot
AUDCAD 0.95386 0.00036 0.4620 -0.5840 0.0001 0.00961 1.84 100
AUDCHF 0.86695 0.00038 0.7020 -0.9270 0.0001 0.01058 1.84 100


THANKS

Re: Micro lot trading [Re: dusktrader] #428913
09/05/13 14:16
09/05/13 14:16
Joined: Jul 2000
Posts: 27,986
Frankfurt
jcl Offline

Chief Engineer
jcl  Offline

Chief Engineer

Joined: Jul 2000
Posts: 27,986
Frankfurt
Hmm, PIPCost and Margin are neither optimistic or pessimistic. So the rounding does not introduce pessimism. I'll look into this for the next version, it should not round but keep the original precision.

Page 4 of 4 1 2 3 4

Moderated by  Petra 

Powered by UBB.threads™ PHP Forum Software 7.7.1