Micro lot trading

Posted By: hughbriss

Micro lot trading - 10/21/12 16:43

Hi JCL and all,

I have a question about the strategy test results. Does the tester start with a certain balance and then add winning and subtract losing trades? If not then what is the % return figure based on?

Also could you please go through how to set up micro lot trading on fxcm and how to set the script to risk a certain % on each trade? I would like the default to be 0.01 so that if you want to risk 1% over 200 pips and there is not sufficient balance in there to risk even 0.01 it still does so.

Thanks
Posted By: jcl

Re: Micro lot trading - 10/22/12 06:58

The tester does not start with a balance - that would not make any sense, as the performance test should obviously not depend on some arbitrary start balance. The performance figures are described here:

http://zorro-trader.com/manual/en/performance.htm

For a micro lot account, either contact FXCM and ask them to convert your current real account to micro lots, or open a new account on http://www.forexmicrolot.com/.

Micro lot accounts are recommended - you can trade with smaller capital and get slightly higher profits, as the smaller lot size allows more precise money management.
Posted By: hughbriss

Re: Micro lot trading - 10/22/12 08:55

Ok, so how would I get a script to trade in micro lots as a percentage of my balance?
Posted By: hughbriss

Re: Micro lot trading - 10/22/12 08:59

Originally Posted By: jcl
The tester does not start with a balance - that would not make any sense, as the performance test should obviously not depend on some arbitrary start balance. The performance figures are described here:

http://zorro-trader.com/manual/en/performance.htm


I can't find any explanation of how the annual return % is arrived at on that page.
Posted By: hughbriss

Re: Micro lot trading - 10/22/12 09:01

To me it makes perfect sense to start with an "arbitrary start balance" because then you can work out your profit and loss if you took trades risking a % of your account on each trade.
Posted By: jcl

Re: Micro lot trading - 10/22/12 09:59

The start balance has no effect on the strategy performance, otherwise wealthy people would always develop better strategies than poor people laugh. Reinvesting a percentage of your profit has certainly an effect. Look in the manual under "Margin" how to set the trade margin, and check out "Money Management" and "Reinvesting Profits" on the following page

http://zorro-trader.com/manual/en/tutorial_kelly.htm

for learning the consequences when you do that.
Posted By: hughbriss

Re: Micro lot trading - 10/22/12 11:02

That doesn't make sense. Of course the start balance has no effect on the results of the system itself but how can you calculate an effective % return figure unless you know how much you started with?

Poor people and rich people can all start with the same notional "arbitrary balance" and come up with the same system.

I have looked at those pages and they don't make sense either. You can't adjust your lot size by using margin unless you know your leverage.

If I have a balance of £1000 and I want to risk 2% per trade then I want to risk £20. If I am using a stop loss of 100 pips then I want to trade at £0.20p per pip. The cost per pip on eurusd is usually around 0.065p per pip so I can trade with 3 micro lots. How does manipulating the margin change this unless you know the leverage?

I know I am still thinking in a mt4 mindset but I would appreciate help with this. Thanks.
Posted By: hughbriss

Re: Micro lot trading - 10/22/12 11:13

What I'm driving at is whether there is an easy way to calculate something like the following...

Lot size = (balance/100)*riskpercent)/stoppips/tickvalue

which is what I have used on mt4 very simply and easily to calculate the position size I need to use in order to risk a set % of my account on each trade of a set stop loss size.
Posted By: jcl

Re: Micro lot trading - 10/22/12 13:25

Ok. The variables have different names in Zorro, so a formula equivalent to yours would look like this:

Lots = Balance/100*riskpercent/(Stop/PIP)/PIPCost;

But the normal method is to set a trade investment by Margin, and a maximum trade risk by Risk, like this:

Margin = Balance/100*riskpercent;
Risk = Balance/100*riskpercent;

The lot amount is then automatically reduced to not exceed the given risk. Finally, when you want to reinvest your balance, definitely check out the Money Management tutorial on the link I posted above. Money management is not trivial and a simple method as in your formula will unnecessarily reduce your profit and increase your risk. The percentage to reinvest is not up to you, it depends on the strategy and must be calculated from the equity curve. The same goes for the initial capital.

If you do not understand something with the tutorial or manual, just let me know what it is. I'm the tutorial guy, so it's my job to help with those questions.
Posted By: hughbriss

Re: Micro lot trading - 10/22/12 14:09

Yes, I sort of understand it. I'm used to just putting 1% on every trade and continuing to do so. As I win I risk more $ per trade and as I lose I risk less. I've never particularly considered the consequences on the equity curve.

So is it better to just risk a certain $ amount per trade and after a year if you have made money increase that $ risk amount a little?

Also how do I code a script to trade micro lots? Do I just change the margin and risk level and it will do it automatically at FXCM's end?
Posted By: jcl

Re: Micro lot trading - 10/22/12 14:16

The 1% method can keep your profit unnecessary low with one strategy, and already give you the margin call with another strategy. Better use the OptimalF method from the tutorial.

The script is no different for micro lots when you use Margin and Risk for setting the trade size. Only when you set Lots directly to a fixed number, the result will depend on the lot size. Lot size, leverage, pip value etc. is automatically determined by Zorro when connecting to a broker, so you normally need not care about it. The simulation is set up for micro lots by default.
Posted By: hughbriss

Re: Micro lot trading - 10/22/12 15:50

Ok, thanks for your patience with this. I will attempt to use the optimalF function and see how it goes.

I have deposited £1000 and I am ready to roll with one of my own strategies. Am I right in thinking that I am better to set the risk level so that the capital required figure comes out at about £500 to £750 to allow some room for error?

This would automatically be taken care of if I was working at a % of my account so this is an approach that I will have to get used to.
Posted By: hughbriss

Re: Micro lot trading - 10/22/12 17:10

OptimalF isn't working for me. I have set up a slider for my script that changes the margin between 1 and 20. It works ok down to about 5 but anything under that will not vary the capital required figure. Is this because it has reached the minimum margin amount to place a 0.01 trade and so can't go lower?

The capital required is a fraction over what I have available so I either need to be able to vary the script to trade with smaller amounts or deposit another few hundred quid.

JCL, thanks again for your patience with this. The tutorials and manual answer a lot of questions but the answers are not always clear for a beginnner especially when it comes to money management for a trader used to mt4.
Posted By: hughbriss

Re: Micro lot trading - 10/22/12 17:27

Does lots = 1 trade 1 micro lot?
Posted By: jcl

Re: Micro lot trading - 10/23/12 06:53

Yes, the Margin < 5 problem is that you've arrived at 1 lot, and a smaller trade size is not possible. If you set the MARGINLIMIT flag, Zorro will sort of emulate smaller lot sizes by trading less frequently.

Lots = 1 trades 1 microlot. It's always the lot size of your broker.
Posted By: hughbriss

Re: Micro lot trading - 10/23/12 07:06

Ok, thanks
Posted By: dusktrader

Re: Micro lot trading - 07/11/13 20:04

Hello, I'm sorry to resurrect an old thread here... but I have some questions regarding microlot trading that brought me here while searching for the answer.

I am looking at definitely using microlot trading when I start live with Zorro, and I see that you do recommend that also. However, I still haven't decided if I will begin with an IBFX microlot account (MT4) or FXCM (more questions on that later).

My question is about how to ensure that Zorro is configured for simulating the IBFX microlot account. This is a 5-digit broker, where 0.01 lot equals USD $0.01 on EURUSD. This is handy for testing strategies because I can just crank down the leverage to pennies while I'm testing.

According to my live IBFX microlot platform (EURUSD):
Digits: 5
Contract size: 10000
Swap long: -0.052
Swap short: 0.038
Margin initial: 10000.00
Margin maintenance: 10000.00

In reading the Zorro manual in the data import/export section, I believe AssetsFix.dta is the file I would need to modify. In several places you've mentioned that the default simulation mode is already set to microlot. However, I'm confused in looking at AssetsMicro.dta because I don't understand the values in the Margin and Lot columns. In the US, I believe the margin limit is 50:1 (not 10:1 as I read on your manual page). So I'm trying to figure out how to set Zorro to reflect 50:1 leverage for simulation purposes.

Also, I read somewhere that Zorro also defaults to 1 lot during simulation. Can you please confirm that a microlot configuration equates 1 lot to be 0.01? That is how I enter it in my platform if I want to risk $0.01 penny. I would like Zorro to use 0.01 broker lots as the minimum.

THANK YOU

PS: it could be that my IBFX account is actually a "mini" account (thus the 10000 contract size) but that they also allow microlot trading in the account.
Posted By: jcl

Re: Micro lot trading - 07/12/13 07:56

Yes, 10000 contracts is a mini lot, not a micro lot. A micro lot is 1000 contracts.

AssetsFix.dta is set up for a micro lot EUR account with 100:1 leverage. Your IBFX account might give different test results. The easiest way to simulate your specific account is just generating an individual AssetsFix.dta.

Use the Download.c script for this. Enable the loop with all assets, click [Trade], and wait until the assets are downloaded, then click [Stop]. You now have a new Assets.dta specific for your account. You can find details about that procedure under "Data Import". Make sure before to remove the assets from the loop that are not supported by IBFX.
Posted By: dusktrader

Re: Micro lot trading - 07/12/13 10:21

Great, I will work on this today!

One other question please... what is the recommended procedure if the assets in my broker are named in a nonstandard way? For example IBFX uses a suffix so all assets end in m for mini accounts like this: EURUSDm USDCHFm

Your loop in Download.c is specifically looking for "EUR/USD" so should I adjust all those to "EURUSDm" etc?

I'm guessing NOT, because I remember reading somewhere that when using MT4, you still pull the actual data from FXCM datafeeds, which probably needs to be in the FXCM format of "EUR/USD". Therefore, how can I adjust my data so that it is able to be used in my scripts from either broker (I haven't decided yet whether I will use FXCM or IBFX but want my scripts to be broker-neutral anyway).

I vaguely remember you mentioning a code snippet that needs to be placed somewhere (top of scripts?) to let Zorro know to swap names.

THANKS
Posted By: Chaosfreak

Re: Micro lot trading - 07/12/13 10:29

Hi,

you can change asset names in Zorro.mq4. There's a function called "assetFix" where you can change the names of specific assets. For your example it would be:

if(Asset == "EURUSD") return("EURUSDm");
Posted By: dusktrader

Re: Micro lot trading - 07/12/13 12:31

Thanks! That makes perfect sense to adjust the .mq4 script instead. I will go ahead and do this laugh
Posted By: dusktrader

Re: Micro lot trading - 07/12/13 15:13

(SIDENOTE: in looking at the Zorro.mq4 script, it seems that broker suffixes are handled automatically, so there is nothing needed to be changed here)

Ok, I tried to do this and it "may" have worked. Can you please look at the attached file here and answer a few questions for me?

The first time I ran the Download script, it produced several errors saying pairs were not available (some were, some weren't). I assumed this was due to the pairs not being available on FXCM's datafeed. At the conclusion of the script run, it crashed Zorro.

So I restarted Zorro with the -diag switch and tried again. However, on this second run, it went through every pair in the loop and said it was successful (see attached Assets.dta file) (SIDENOTE: the reason for the initial crash "could" have been that the MT4 demo platform was a brand-new install, most pairs had never been opened even once. The reason for this is because I never use demo platforms, only live. This theory could explain why the 2nd run of the script was able to identify every pair requested.)

I have a couple questions now:
1) The pairs that IBFX uses do not have a slash between the instrument (ie, EURUSD instead of EUR/USD). My question is, will Zorro handle this correctly, or do I need to tell the Zorro.mq4 script to translate them to have the slash? My understanding is that pricing will be coming from the FXCM datafeed when using the MT4 plugin.

2) Presumably I will need to remove the default Zorro assets that are currently still in the Assets.dta file attached here (for example EUR/USD is the default to be removed, whereas EURUSD is the IBFX-downloaded asset)

Once I get this Assets.dta file cleaned up/correct, I'll post it back here for others who may want it. These assets represent all the live-tradeable assets on a US-based IBFX mini platform (I downloaded them from the demo, but I only included the ones available on live platform)

THANKS


Description: Assets.dta and script
Attached File
Download_IBFXmini.zip  (93 downloads)
Posted By: dusktrader

Re: Micro lot trading - 07/12/13 16:16

Ok, I've verified that all of the live-tradeable IBFX pairs are also available on the FXCM datafeed (from here: http://www.fxcm.com/products/forex/currency-pairs )

So I believe I only need to determine whether or not the Assets.dta and AssetsFix.dta need to be in the FXCM format with the slash (ie, EUR/USD) or if it is acceptable to leave them in the IBFX format (ie, EURUSD)

If the slash is required, then it should just be a few simple changes to the Zorro.mq4 script as noted above.

How should I go about acquiring history testing data from FXCM datafeed for the remaining pairs? On IBFX there are 27 pairs that I follow. Is there a place to download individual tickdata for each pair from IBFX? If not I can get it from another source, but I prefer to keep it consistent as possible.
Posted By: dusktrader

Re: Micro lot trading - 07/12/13 18:59

I'm still tinkering around with this and have learned the following:

1) apparently it does matter -- Zorro wants the Assets.dta and AssetsFix.dta pairs to include the slash (ie, EUR/USD). When I attempted to train/test my strategy, it did manage to find the pairs when I had removed all the slashes from Assets.dta, but it then proceeded to add them back as additional instruments with the slash in the name. So I've reset the Assets.dta and AssetsFix.dta to include only the IBFX instruments, and all listed with the slash. Presumably, I need the translation code added to the top of the Zorro.mq4 script based on this.

2) however, now I'm confused. After updating the Assets.dta files and retraining/testing my script... it now shows dramatically different results (including an ulcer index over 2000% YIKES!) So it seems something is not right here. And it definitely has to do with this change to Assets.dta and AssetsFix.dta I believe -- I see no other changes to actual history files here.

Also, before changing the .dta files, I made a complete backup of the entire Zorro History folder. If I swap back in the old history folder, my script tests as expected. As soon as I swap back to the new .dta files, the performance gets screwy.

I'm attaching my BEFORE and AFTER .dta files here... maybe this will have some clues?

THANKS


EDIT: I'm attaching also results from a strategy I've been playing with from the forum... the ONLY change between these results is swapping the Assets.dta files... I'm "expecting" the results to be somewhat similar, but they're not.


Description: BEFORE (should be Zorro defaults)
Attached File

Description: AFTER modifying for IBFX mini
Attached File
Assets -- AFTER.zip  (103 downloads)

Description: Test results
Attached File
results.zip  (101 downloads)
Posted By: dusktrader

Re: Micro lot trading - 07/15/13 12:36

Here are some more simple results to look at, from the default Workshop4_1.

I'm trying to determine if this is normal/correct, or if there is some problem. What are the reasons that could cause this situation between my IBFX mini account and the default Zorro settings?

One thing that seems unusual is the 'Lot' column in my IBFX Assets.dta file. If this is incorrect, could it indicate a glitch in the Download.c script and/or the Zorro.mq4 script?

Here are the Workshop4_1 test results comparing the default Assets.dta with the IBFX-downloaded version:

Default Zorro settings
Code:
BackTest Workshop4_1 EUR/USD - performance report

Test period         10.01.2008-10.06.2013
Lookback time       141 bars (5 days)
Assumed slippage    10.0 sec
Assumed spread      2.4 pips (roll -0.10/0.02)
Contracts per lot   746

Gross win/loss      1464$ / -1004$ (+6167p)
Average profit      85$/year, 7.08$/month, 0.33$/day
Max drawdown        -137$ 30% (MAE -169$ 37%)
Total down time     71% (TAE 98%)
Max down time       71 weeks from Jun 2009
Largest margin      10$
Trade volume        432293$ (79819$/year)
Transaction costs   -76$ spr, -4.47$ slp, -6.71$ rol
Capital required    112$

Number of trades    424 (79/year, 2/week, 1/day)
Percent winning     18%
Max win/loss        216$ / -14$
Avg trade profit    1.09$ 14.5p (+19$ / -2.89$)
Avg trade slippage  -0.01$ -0.1p (+0.04$ / -0.06$)
Avg trade bars      83 (+358 / -22)
Max trade bars      2106 (18 weeks)
Time in market      105%
Max open trades     2
Max loss streak     18 (uncorrelated 33)

Annual return       83%
Profit factor       1.46 (PRR 1.23)
Sharpe ratio        0.62
Kelly criterion     0.50
OptimalF            .032
Ulcer index         16%
Prediction error    41%

Portfolio analysis  OptF  ProF  Win/Loss

EUR/USD:L           .027  1.25   41/171   
EUR/USD:S           .038  1.66   36/176



IBFX settings acquired from Download.c
Code:
BackTest Workshop4_1 EUR/USD - performance report

Test period         10.01.2008-10.06.2013
Lookback time       141 bars (5 days)
Assumed slippage    10.0 sec
Assumed spread      2.0 pips (roll -0.05/0.04)
Contracts per lot   100

Gross win/loss      194$ / -140$ (+5394p)
Average profit      9.96$/year, 0.83$/month, 0.04$/day
Max drawdown        -22$ 42% (MAE -28$ 52%)
Total down time     72% (TAE 98%)
Max down time       92 weeks from May 2011
Largest margin      5.22$
Trade volume        57948$ (10700$/year)
Transaction costs   -8.48$ spr, -0.60$ slp, -10$ rol
Capital required    55$

Number of trades    424 (79/year, 2/week, 1/day)
Percent winning     18%
Max win/loss        33$ / -1.92$
Avg trade profit    0.13$ 12.7p (+2.58$ / -0.40$)
Avg trade slippage  -0.00$ -0.1p (+0.00$ / -0.01$)
Avg trade bars      83 (+350 / -25)
Max trade bars      2106 (18 weeks)
Time in market      105%
Max open trades     2
Max loss streak     24 (uncorrelated 34)

Annual return       20%
Profit factor       1.39 (PRR 1.16)
Sharpe ratio        0.54
Kelly criterion     1.60
OptimalF            .294
Ulcer index         18%
Prediction error    41%

Portfolio analysis  OptF  ProF  Win/Loss

EUR/USD:L           .000  0.67   31/181   
EUR/USD:S           .294  2.27   44/168

Posted By: dusktrader

Re: Micro lot trading - 07/15/13 13:26

Ok in further digging, I believe this is related to the LotFactor being set by Zorro.mq4. I did a quick test and it seems that IBFX is returning 0.01 for the MODE_MINLOT value.

If I force the LotFactor to be 0.1, then I get a Lot setting in Assets.dta of 1000 which gives the backtest similar results to your defaults.

So at this point I'm just trying to determine what other factors could be involved (ie, a glitch?) that could cause the detrimental results.

Presumably, if I force the Lot to 1000 in Assets.dta, but keep all the rest of the figures the same for IBFX, then Zorro would simply trade with a higher lot size than the broker minimum. However, it would be ideal to trade microlots at a minimum of 0.01 units.

THANKS laugh

PS: Let me know what else I can do on my end, to help you further investigate.
Posted By: jcl

Re: Micro lot trading - 07/16/13 07:44

The reason is a Zorro bug which only affects tests with a low drawdown value, less than $100.

The return is calculated from the drawdown, and for this Zorro adds the minimum margin to the drawdown. That's ok so far, but as the minimum margin depends on the asset, it uses an average value of $50 which is too high for your nano lot account. This makes all tests with low drawdown too pessimistic. Another user had a similar problem.

This will be fixed in the next Zorro version. Until then, when you simulate different accounts, use a high margin or lot size to keep the drawdown high enough so that the additional $50 don't noticably drag down the annual return.
Posted By: dusktrader

Re: Micro lot trading - 07/16/13 10:27

That's great to hear (it means I'm not really going insane then!) Actually it's good to know this is a known issue, I like them better because they're easier to fix!

Can you answer me this please: what is the effect if I simply force the MODE_MINLOT value to be 0.1 instead of 0.01? In other words, if I simply change Assets.dta to have a lot of 1000, instead of 100?

I'm hoping you will say: that's fine, it just means that Zorro's minimum lot size will be bigger than your account can actually do. But for the purpose of accurate backtesting, this should be fine.

Separately, can you please confirm that your default Assets.dta files are configured for an account with deposit currency of EUR? I believe this might be the case. I'm guessing it might have "some" effect on example strategies, but hopefully not significant (as compared to what I'm getting from my USD broker).

THANKS
Posted By: jcl

Re: Micro lot trading - 07/16/13 14:35

You have to change AssetsFix.dta in that case - Assets.dta is for storing the current account data, while AssetsFix.dta is the account used in the simulation.

Setting Lots to 1000 should work. But you must then also set PipCost to a 10x higher value.

Yes, the default account is a micro lot EUR account, with a lot size of 1000 contracts.
Posted By: dusktrader

Re: Micro lot trading - 07/16/13 16:16

While I wait for the next Zorro version (that can hopefully fix the stats issue with nano accounts)... can you please confirm:

it seems that a very simple workaround I could do is to simply boost the number of (flat) Lots in my script, to make them above the threshold of the bug.

For example, if I just add "Lots = 10;" to the Workshop4_1 script while using my IBFX-downloaded Assets.dta and AssetsFix.dta files, the results may be correct.

I think the variance between the default Zorro Assets.dta file could just be the fact that my file is representing a USD deposit currency:

default Zorro Asset.dta Workshop4_1 result (EUR deposit currency):
Code:
Workshop4_1 compiling...............
Lookback set to 141 bars
BackTest: Workshop4_1 EUR/USD 2008..2013
Profit 460$  MI 7$  DD 137$  Capital 112$
Trades 424  Win 18%  Avg +14.5p  Bars 83
AR 83%  PF 1.46  SR 0.62  UI 15.9%  Error 41%



IBFX-US nano account (USD deposit currency):
(while also adding Lots = 10; in the script)
Code:
Workshop4_1 compiling...............
Lookback set to 141 bars
BackTest: Workshop4_1 EUR/USD 2008..2013
Profit 539$  MI 8$  DD 224$  Capital 219$
Trades 424  Win 18%  Avg +127.2p  Bars 83
AR 60%  PF 1.39  SR 0.54  UI 18.2%  Error 41%



I like this simpler fix/workaround (if you agree) and would like to be able to put this issue to bed. I don't care too much about $ values, I'm more concerned with accurate percentages.

THANKS
Posted By: dusktrader

Re: Micro lot trading - 07/18/13 11:13

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
Posted By: jcl

Re: Micro lot trading - 07/18/13 12:35

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.
Posted By: dusktrader

Re: Micro lot trading - 07/18/13 12:49

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
Posted By: jcl

Re: Micro lot trading - 07/18/13 13:10

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.
Posted By: dusktrader

Re: Micro lot trading - 07/18/13 13:50

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
Posted By: dusktrader

Re: Micro lot trading - 07/18/13 14:56

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 File
Posted By: jcl

Re: Micro lot trading - 07/19/13 09:36

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.
Posted By: dusktrader

Re: Micro lot trading - 09/05/13 12:44

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
Posted By: jcl

Re: Micro lot trading - 09/05/13 14:16

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.
© 2024 lite-C Forums