Trailing funds function (equity) - has anyone come across a ready-made one?

 

Actually subzh, while wise and trying to write one, maybe someone can throw a ready-made, so I do not reinvent the wheel.

ZS: A search on the forum did not give anything useful, maybe I searched badly...

 
How's that? Like if equity is down, pull it back up to balance? :)
 
Trailing funds, how?
 
alexx_v писал(а) >>
Actually sabotage, while wise and trying to write one,

I didn't get the gist of it... maybe I wasn't catching it right...

 
Здравствуйте.
A System: Championship 2008 Revised Edition:

...
static double             ad.MaximalEquity                                                                      ; //<  7>
if   ( AccountEquity () > ad.MaximalEquity     )   ad.MaximalEquity = AccountEquity ()                          ; //<  8>
if   ( AccountEquity () < ad.MaximalEquity / 2 )   return                                                       ; //<  9>
...
 
С уважением,
Ais.
 
bstone писал (а) >>
What's that? Like if equity is low, then pull it back to balance? :)

You're a joker, though :)))

Xupypr wrote (a) >>
Trailing funds, what's that?

Trailing stops - I see, but trailing equity (dozens of different positions) by virtual stops, say - in the form of recording in global variables of the terminal stop, step and distance values in equity units - is it not clear? :)

KimIV wrote (a) >>

I didn't get the gist of it... >> maybe I wasn't catching it right.

maybe, or maybe I have never needed it, that's why I haven't understood it :) by the way, I'm looking at your Expert Advisor, e-CloseByLossOrProfit.mq4, I think it may change it a bit, replace AccountProfit( ) by AccountEquity( ) and add this trl... and remake this all as a function to add to my EA...


ZS: all of a sudden, I have not understood it... :)

ok, i will explain the question in more detail:

I would like to place a stop, but not the commonly used stop for a deal, but a virtual one, so the EA would keep it "in mind". Besides, I would like this "stop" to trawl for equity, if necessary, sometimes I need it to close all deals as equity values approach this "stop" and... probably write a ban to all other EAs in global variables of the terminal (to put a salary before closing all deals)

 

Like this...

Create a global variable and write the current profit there...

Suppose in conditions, when the profit drops below 30% , we close.

As in trailing stop (t-stop) we start working in the positive zone.

Its value can be calculated based on the position volume, for example,

Let us assume it is 1 lot of Eurobucks, or $10 per pip, then, say, from $300 we start

"that is practically equivalent to 30 pips...

Or even an empirical value.

*

When you ask what for? There are many of these "why", for example for dealing without t-c's

I don't want to hang a bunch of experts, especially for a portfolio...

By the way, it is more necessary for a portfolio. ;)))

 
Ais писал(а) >>
static double ad.MaximalEquity ; //< 7>
if ( AccountEquity () > ad.MaximalEquity ) ad.MaximalEquity = AccountEquity () ; //< 8>
if ( AccountEquity () < ad.MaximalEquity / 2 ) return

so StopTrade at half-time highs???

 
Да.
 
alexx_v писал(а) >>
I want to place a stop, but not the usual stop on a deal, but a virtual one, so that the EA would keep it "in mind",

Well, that's what it's called - StopVirtual. Volodya (Tartan), as far as I remember, is particularly fond of such things. Go to his forum. He must have some similar stuff.

 

here... found...