Margin Warning

Posted By: DdlV

Margin Warning - 07/11/14 23:18

Hi jcl. Does Zorro have access to the account's margin status? Can it pop up a warning message if available account margin falls below a threshold value or %?

EDIT: A little more information: What spawned this question is Z5. Not Z5 per se, but Z5 carrying many old trades from old versions for a long time. The Z5 I'm running is over 50% margin committed via open trades still being handled by 1.20. 1.24 doesn't know of those trades and therefore (I assume) can't take them into account.

Even if 1.24 doesn't open new trades because there isn't enough margin, price moving in the wrong direction could still via all those 1.20 open trades significantly move equity to the point of margin call, correct?

Thanks.
Posted By: jcl

Re: Margin Warning - 07/14/14 14:18

You can do that already, like this:

if(Equity - MarginVal < 1000) printf("\nMargin dangerously low!");

For being safer, it makes sense to contact your broker and request to switch your account to higher leverage. FXCM accepts 1:200 on request when you don't live in the US.
Posted By: DdlV

Re: Margin Warning - 07/14/14 14:31

Thanks jcl.

Except, not on a Z system. frown Could this be implemented as a Z<n>.ini switch?

Thanks.
Posted By: jcl

Re: Margin Warning - 07/14/14 14:40

Ok, I'll check if that can be done.
Posted By: DdlV

Re: Margin Warning - 07/16/14 13:53

Thanks jcl. One other question: Outside the US, FXCM offers 1:50, 1:100, and 1:200 via their MyFXCM maintenance portal. However, they also offer up to 1:400 by special request (no idea what their approval criteria is or how often this is granted). Do you have a position/recommendation re. 1:400?

Thanks.
Posted By: jcl

Re: Margin Warning - 07/17/14 08:07

If you can get 1:400, do it. Contrary to popular belief, higher leverage reduces the risk. Of course, if a margin call happens nevertheless, your account will be wiped more thorougly.

Normally you should always take the highest leverage that you can get.
Posted By: DdlV

Re: Margin Warning - 07/17/14 12:58

OK, I've requested 1:400. Assuming they approve the request, what steps do I take with Zorro? Do strategies need to be stopped & restarted? What else besides reTesting for new M/R settings?

Thanks.
Posted By: jcl

Re: Margin Warning - 07/17/14 13:36

No steps required. You can just continue.

Test with the new settings, when you put them in AssetsFix.dta, will reveal a smaller capital requirement. In most cases it's only a small difference, except probably for Z4 and Z5.
Posted By: DdlV

Re: Margin Warning - 07/23/14 22:34

Hi jcl. I am informed by FXCM that they will not change an account to 1:400 if it has open trades. Therefore, I'm thinking of this plan (similar to upgrade):

1) Establish new account with 1:400
2) Install an additional Zorro with separate folders
3) Use the Download script to update Assets.dta
4) Copy Assets.dta to AssetFix.dta
5) Test to determine the new Margin setting for the original CR
6) Set Margin to 0 on the old account to just run the open trades to close
7) Trade the strategy on the new account setting Margin to the Tested value

Any problems with this plan?

EDIT: And how do I determine how much needs to remain in the old account to support the closing trades?

Thanks.
Posted By: jcl

Re: Margin Warning - 07/24/14 07:34

Looks like a good plan. As to the remaining capital, the upper limit is the sum of all "Risk" amounts of the open trades, from the log file.
Posted By: DdlV

Re: Margin Warning - 07/24/14 12:08

Thanks!
Posted By: DdlV

Re: Margin Warning - 07/25/14 13:45

Hi jcl. Evidently FXCM person A didn't know what they were talking about. I've just received notification from FXCM person B that the accounts have been changed to 1:400 and that appears to be borne out in TS.

That should end this thread. Further issues will go into the other Margin thread.

Thanks.
Posted By: DdlV

Re: Margin Warning - 11/23/14 08:18

Hi jcl. One more issue related to transitioning between accounts, using example numbers:

Existing account A was started with $2000 CR using Margin 50 that Tested to that CR. Account A now has $3000 balance and the open trades have Risks totaling $2500.

For whatever reason, want to transfer to new account B.

Per above, $2500 needs to stay in account A while the open trades are run to completion with Margin 0 to prevent opening new trades.

$500 ($3000 balance - $2500 Risks; Equity's irrelevant to this, right?) can be moved to the new account B.

The question is what value should be used for Margin on account B? It shouldn't be 50, should it? (Since so little $$$'s been moved to account B...)

Should it be whatever Tests to $500 CR? And then as trades close in account A, the appropriate additional funds can be moved from A to B, and B's Margin setting increased?

Thanks.
Posted By: DdlV

Re: Margin Warning - 12/02/14 17:15

Hi jcl. Related to the Margin setting for new account B question above...

Z3 yesterday closed all trades for losses. Today it opened a single trade with a Risk value greater than the account's balance. Is that correct?

If so, and the printed value is an overestimate of actual risk, how would I determine what the actual amount at risk is so I can subtract and get the amount eligible to move to the new account B?

Thanks.
Posted By: jcl

Re: Margin Warning - 12/04/14 08:53

The maximum risk is printed for any opened trade. As long as RISKLIMIT is not set, the balance does not matter for the risk. The capital does not matter either, as it is calculated from the drawdown, not from the trade risk.

Posted By: DdlV

Re: Margin Warning - 12/04/14 16:03

Thanks jcl. I believe I understand what you're saying - however, I'm still confused. This is Z3, so RISKLIMIT is whatever it sets. I understand that the maximum risk printed is based on the Margin & Risk slider settings, not the account's balance. Where I'm lost is in the "close the loop", "total consistency" aspect. The Margin & Risk settings were determined via Testing to the Capital available to invest - the initial balance. This CR reflects the maximum drawdown, which by definition can't exceed that CR = initial balance. Therefore, if all is consistent, how can the printed risk for 1 trade exceed the account's balance?

Separately, I'd appreciate your comment re. the Margin setting to use when transitioning between accounts & before the old trades are closed on the old account, as in the example above.

Thanks!
Posted By: jcl

Re: Margin Warning - 12/04/14 16:32

The Z systems do not use RISKLIMIT or supervise your account in any way. You must do that yourself. When the risk is higher than the account balance, you can reduce the margin, or add more money - all this is up to you. It's not done automatically by the trading software.

For moving a system to another account, I'd leave enough money in the old account so that the risks of all still open trades are covered.



Posted By: DdlV

Re: Margin Warning - 12/04/14 17:53

Thanks jcl.

Re. moving a system to another account: Please re-read the example above. The question was not about how much money to leave in the old account. The question was what Margin setting to use on the new account when only part of the balance has been transferred.

Re. risk per trade: I'm very well aware of the need to monitor - I've already had to add funds twice to (narrowly, barely) avoid margin call on Z5. frown My question is about stepping back and looking at the "big picture" interrelationships of the various factors/parameters and how they all "hang together" consistently. If I've Tested to determine the CR for a given Margin/Risk setting, and funded the account with that CR balance, how then does Z3 open a trade with risk exceeding the CR/balance? That seems inconsistent to me, and makes me suspect the veracity of Test results.

Thanks.
Posted By: jcl

Re: Margin Warning - 12/05/14 08:55

I would reduce the margin in the new account by the same percentage as the capital was reduced. When the trades in the old account are closed and the rest capital is transferred, the margin can be increased to the previous value.

Why should Z3 not open a trade dependent on your balance? Z3 does not even know your balance. The balance also has nothing to do with test results or required capital. The required capital is based on statistical risk, not on the stop distances of single trades.

http://manual.zorro-trader.com/performance.htm
Posted By: DdlV

Re: Margin Warning - 12/05/14 16:36

Thanks jcl.

Re. new account: That makes sense and is easier than Testing. laugh

Re. risk: What's confusing me is perhaps encapsulated in your 3rd sentence. The balance is actually directly related to Test results and CR - in fact it's exactly equal to the Tested CR. That's why I don't understand how the printed risk of this single trade can exceed the balance = Tested CR. Take "balance" out of this and just focus on CR. There seems to me to be a disconnect between the statistical simulation and its results vs. what Zorro then does trading using those Tested settings. How can the Tested CR be considered the "safe" or "worst case" value to trade the system if a single trade's risk is sufficient to not only hit but exceed margin call?

Thanks.
Posted By: jcl

Re: Margin Warning - 12/09/14 09:32

The CR is just derived from the backtest. It is not 100% "safe" - there is no guarantee that you won't need more capital in live trading. The displayed "risk" is just the distance to the stop and has nothing to do with the statistical risk of the system. The system risk is normally higher, but can also be lower than the stop distance in some cases. For instance when the system is unlikely to hit the inital stop, or when the live stop was more distant than any stop in the backtest.

I can not say it often enough: There is no real "safe" balance and no "guarantee" against a margin call. Your trading is based on statistical probabilities, not on guarantees.
Posted By: DdlV

Re: Margin Warning - 12/09/14 18:17

Thanks jcl.

Big Picture #1: Yes, I understand your comments re. statistics & safety. I understand this is not at all "set and forget". I attempt to monitor at least daily - hopefully that will be enough so I won't get burned... Have come too close for my tastes already... frown

Big Picture #2: CR is from backtest using the given Margin & Risk settings. If Trade and Test function the same, then those Margin & Risk settings should have produced during Test trade(s) with the same displayed "risk". Evidently the Test never closed such a trade at the worst possible point, hence that risk was never realized, hence CR is smaller than if it had been. However, in real Trading that could happen which would in fact lead to margin call if the system is started with no more than the Tested CR. Is that the correct way to view/understand Test vs. Trade?

Thanks.
Posted By: jcl

Re: Margin Warning - 12/10/14 15:31

Partially. A backtest drawdown smaller than the stop distance is theoretically possible, but unlikely. More likely is a higher stop distance in live trading than in the backtest.
Posted By: DdlV

Re: Margin Warning - 12/10/14 17:18

Thanks jcl. I think I get it now! laugh

But it leads to another question: Does it make sense to consider storing additional results from Test - for example the maximum risk as discussed above - basically a description of the Tested "world" - and then in real Trading compare the calculated values to these stored values to flag (perhaps via a pop-up) when the strategy is leaving its known "world" and entering a "new world", possibly requiring more Capital or needing some other attention?

Thanks.
Posted By: jcl

Re: Margin Warning - 12/11/14 08:45

This is indeed one of the goals system developers try to achieve - stopping a system when the market behaves differently that in the test. The problem is that live trading is always a new world. You must draw a line somewhere. A higher stop distance, as caused by an unusual weekend gap or a high volatility period, is normally harmless. So this certainly makes sense, but is a difficult matter.
Posted By: DdlV

Re: Margin Warning - 12/11/14 16:14

Thanks jcl.
© 2024 lite-C Forums