Hi Guys,
Does someone of you have an average MAE/MFE snippet as indicated on the backtests results ?
Thanks and have a nice day
no idea how you would code that, but you can always drag the results into Excel if you just want to know the averages.
Or do you want to use that data as part of your strategy?
Thanks @Nicolas
But
Link1 : Doesn’t work
Link2 : It’s an indicator not in proorder
Link3 : I will try
@nonetheless
Yes I want to try a filter based on
Have a nice day Guys
The link3 with your code @Nicolas seems not to work
Any ideas ?
It is a calculation in points, not in currency, I do not understand the comparison?
It’s in EUR/USD so 1 pip=10 USD easier to calculate and verify
The problem seems to be when PRT calculate MFE
As you see on the picture
The abs perf (In this strategy) is 300 USD (Stop loss) and as you see on the strategyprofit curve its never higher of 300 USD (on this trade)
But in the backtest result we have a MFE of 336 USD ???
@Nicolas
To try use a strategy on EUR/USD, put a stop/target at 300 USD
Add
graph (((high-positionprice)*pointvalue)*countofposition)/pipsize
You will have a “band” between -300/+300 but a MFE higher ??
Don’t understand why, or it’s a bug
So
(((high-positionprice)*pointvalue)*countofposition)/pipsize
was the calculation you were looking for to compute the MFE for a long order, right?
For the 336USD MFE, please share the code so I can replicate and find out why, thanks.
I will send you, but first, very often on a backtest MFE is a Zero
A bug I see very often
Try with this simple code for example:
defparam cumulateorders=false
//dummy strategy
if rsi[14] crosses over 50 then
buy 100000 contracts at market
endif
set stop ploss 25
SET TARGET PPROFIT tg
//increase the array index
if not longonmarket and longonmarket[1] then
index=index+1
endif
//compute the MFE
if longonmarket then
mfe = max(mfe,high-tradeprice)
$mfeArray[index] = mfe
endif
//at least 10 orders to allow the average calculation
if isset($mfeArray[2]) then
sum=0
for i = 0 to index do
sum=sum+$mfeArray[i]
next
avg = sum/index
endif
graph avg
On backtest results MFe and MAE are generally Zero
And when you have MFE it’s over the Target …
Seems to have different bugs
Another, problem, with the same code above
With tg=41 for example
If we add all MFE and divide py 8=number of trades, the results (Average MFE is 287.5)
BUT if you see teh backtests results it gives 258.75 …