Equity curve trading could be very easy in MC9s+
3 replies
eastpeace
7 years ago #242452
Using PMM in MC, It’s easy to manage the order according the simulated equity curve.
https://futures.io/easylanguage-programming/39106-position-sizing-equity-curve-trading.html
https://www.usingeasylanguage.com/equity-curve-feedback-pro2017new/
http://easylanguagemastery.com/equity-curve-indicators/
0
Tomas Matejka
7 years ago #242460
Hello,
if you refer to equity control this is not yet support with SQX. You could add a feature request for this but it would have low priority in development
0
eastpeace
7 years ago #242862
But I am not sure that the equity trading is better or not.
It depends on the type of strategy and the control of the equity curve, the way the order is filtered.
It’s easy to trade one symbol with one strategy. We need one strategy copy, one (A) for simulated trading account, another(B) for an real account, or other account, in Multicharts’s Portfolio.
We need to add a condition to control the equity, and pass this value to the portfolio money management signal.
Let strategy A run always. And the strategy B depends on the shape of the equity curve of Strategy A and your equity control method.
Here is a sample for equit curve filter by its average. When the equity is below the average, it stops entry. It restart to trade when the curve is above the average.
But the result is worse than the original.
Put this in you trading strategy signal at the end
//begin
Inputs:
LRSlopeLen(30);
Array: a_NetPL[](0);
condition1 = Array_setmaxindex(a_NetPL,LRSlopeLen);
Vars:
TotTds(0), tradesnum(0),equityavg(0),equitystd(0);
TotTds = TotalTrades;
If TotTds > TotTds[1] then begin
For value1 = LRSlopeLen downto 2 begin
a_NetPL[value1] = a_NetPL[value1-1];
end;
a_NetPL[1] = InitialCapital + NetProfit;
For value1 = LRSlopeLen downto 1 begin
if a_NetPL[value1] = 0 then begin
tradesnum = 0; // #trades less than 30
end
else begin
tradesnum = 1;
end;
//print(“date=”,d,” time=”,Time,” equity=”,”Netprofit”,value1,” “,a_NetPL[value1],” avg=”,equityavg);
end;
end;
//if the trades less than 30, let the strategy run always
if tradesnum = 0 then pmms_set_strategy_named_num(pmms_strategies_get_by_symbol_name(symbolname), “euityaverage”, 1);
if tradesnum = 1 then begin
equityavg = AverageArray(a_NetPL,LRSlopeLen);
if a_NetPL[1]>equityavg then //when the equity is above the average, strategy run
pmms_set_strategy_named_num(pmms_strategies_get_by_symbol_name(symbolname), “euityaverage”, 1);
if a_NetPL[1]<equityavg then // when the equity is below the average, strtegy stop
pmms_set_strategy_named_num(pmms_strategies_get_by_symbol_name(symbolname), “euityaverage”, 0);
end;
//end
Here is the portfolio money management signal
// start
variables:
portfolioStrategies(0),
EquitySlope(0);
pmms_strategies_deny_entries_all();
pmms_strategy_allow_entries(0); //allow every trades in simulation account , strategy A
EquitySlope = pmms_get_strategy_named_num(0, “euityaverage”); //get the filter value in Strategy A
if EquitySlope=1 then pmms_strategy_allow_entries(1); //run strategy B when equity in strategy B is above average
//end
Reference link,
https://www.multicharts.com/discussion/viewtopic.php?f=1&t=49287&p=119431#p119431
0
Tomas Matejka
7 years ago #243024
Thanks for the useful code.
As for equity control generally. I believe it works only in limited fashion. It can work for SOME systems that tend to concatenate winners and losers into streaks obviously. But you can also miss the beginning of the winning streak with this easily! For most systems it does not make too much sense really. As soon as you have a system with positive expectancy you better be in next trade. I have seen many systems that tend to work their best right after it hits the worst drawdown. What kind of egde is represented by the fact the last trade ended up as a loser? Does it provide more chances for the very next trade to be a loser? I do not believe so. It looks great when applied on historical equity curves but all sequences with all systems are unique and random
0
Viewing 3 replies - 1 through 3 (of 3 total)