An advisor that is not afraid of a margin call. Who would like to try it out? - page 3

 
YuraZ >> :

a little visual analysis - which is pretty good at actually showing what is what

USDCHF - too many trades

usdjpy similarly holding so long and not fixing it is not the best option - also too many trades

usdcad drawdowns are not good, again too many trades and it looks like one of the baes was on a technical breakout

Reshetov's trading logic is a bit unaccustomed to the standard understanding of trading, and the options "no fix for so long" and "drawdowns are no good here" are a bit, to put it mildly - not good, because they will kill the logic at the root, you can not consider one pair taken separately - in this case there is no logic... only all in aggregate and for a specific time interval

of course there are a lot of deals, a lot

 
alexx_v >> :


>> of course there are a lot of deals, a lot.

Basically, if anything, the number of trades can be reduced by times, just by moving to a larger timeframe. This EA is based on M1, hence the result.
 
It's better to get rid of the TF altogether...
 
Vinin >> :

Yura. So lie the code, because I'm sick of breaking it all the time.

And why break the code when the EA's logic is quite primitive?


1. If the margin level drops below the set one, then EA closes some part of the position and the level goes up.

2. If the margin level rises above the set level, then advisor fills and the level falls


That's it. The principle of a cybernetic water level regulator in a toilet cistern, based on a scientific analogy.



The rest is up to taste and the programmer's wildest imagination.
 
Reshetov писал(а) >>

And why break the code when the EA's logic is quite primitive?


1. If the margin level falls below the set level, then the EA closes part of some position and the level rises

2. If the margin level rises above the target level, then the EA closes a position and the level falls


That is all. The principle of a cybernetic regulator of water level in the toilet cistern, if we proceed from a scientific analogy.


The rest is up to taste and the programmer's wild imagination.

About the wild imagination. I wouldn't have thought of that. Although the truth is out there. I have nothing against exuberant fantasy, I just prefer to look at the code first. And in many cases it's enough. I don't even know how to say in this case, the code is short, my favourite. But the logic is interesting, although I've seen similar logic before. Worth a few months of my life (was just doing it). It's about your first neuron. And the logic is entertaining. No argument.

 
Vinin >> :

About the violent fantasy. That wouldn't have occurred to me. The truth is out there, though. I've got nothing against fantasy, I just prefer to look at the code first. And in many cases that's enough. I don't even know how to say in this case, the code is short, my favourite. But the logic is interesting, although I've seen similar logic before. Worth a few months of my life (just did it). It's about your first neuron. And the logic is entertaining. No argument there.

The thing is that there is no logic, but cybernetics - the science of bourgeois obscurantists.



If anything, the code below will be quite enough for a normal programmer:


...

double orders = equity / (4.0 * MarketInfo(s, MODE_MARGINREQUIRED)) - count;

...



Where:


orders - volume on which the position on instrument s needs to be filled, if the value is positive. If orders is negative, then absolute value shows number of lots, by which some position of s instrument should be closed. The most important thing is not to forget to run MathAbs(orders) through normalizedouble() to avoid trading orders causing errors.

s - instrument name

count - total volume of all positions opened by the instrument s, calculated to the above code section.



Well, that's how it is implemented in my current situation. I.e., the most primitive variant when the volumes of positions for all three symbols are equal.


As the pledge is 3/4 of equity (1/4 - stash or NC), the margin level will be adjusted at 133.33%, i.e. inversely proportional to the pledge - 4/3.


I repeat, this is the current variant of implementation, the dumbest and most primitive one that has been inserted into the code to keep the margin level near a specified value, i.e. to make the drawdown of margin level close to zero.

 

The report can scare investors, as the drawdown on the balance sheet is more than 100%:


Server: Alpari-Demo

Login: 1036148

Investor password: mt3bmid


Maximal Drawdown: 12 368.95 (122.56%) Relative Drawdown:

122.56% (12 368.95)

 

I tried to raise the deposit by another $1000, i.e. just over 5%. The Expert Advisor struggled with it in just over an hour:


Summary:
Deposit/Withdrawal: 10 000.00 Credit Facility: 0.00
Closed Trade P/L: 7 491.38 Floating P/L: 0.00 Margin: 0.00
Balance: 17 491.38 Equity: 17 491.38 Free Margin: 17 491.38

 

sounds like a miracle

 
wenay >> :

>> sounds like a miracle.

There are no miracles. Because during that hour the equity drawdown reached almost -$3000.


But it is one thing to sit through a drawdown when the margin level is dancing just above the margin call level, but it is another thing to sit through a drawdown when it stably stays above 100%.