Average MFE/MAE snippet
Forums › ProRealTime English forum › ProOrder support › Average MFE/MAE snippet
- This topic has 11 replies, 3 voices, and was last updated 3 years ago by zilliq.
-
-
04/07/2021 at 6:10 PM #16643904/08/2021 at 8:16 AM #166456
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?
04/08/2021 at 8:19 AM #166457Some examples about MAE/MFE calculation:
https://www.prorealcode.com/topic/mae-mfe-code-indicator/#post-129348
https://www.prorealcode.com/topic/mae-and-mfe-calculator/
https://www.prorealcode.com/topic/mae-maximisation/#post-143693
1 user thanked author for this post.
04/08/2021 at 8:31 AM #166463Thanks @Nicolas
But
Link1 : Doesn’t work
Link2 : It’s an indicator not in proorder
Link3 : I will try
Yes I want to try a filter based on
Have a nice day Guys
04/08/2021 at 8:37 AM #16646404/08/2021 at 8:58 AM #16646704/08/2021 at 9:31 AM #166475It’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 ???
04/08/2021 at 9:39 AM #166480To 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
04/08/2021 at 9:57 AM #166483So
1(((high-positionprice)*pointvalue)*countofposition)/pipsizewas 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.
04/08/2021 at 11:41 AM #16651604/08/2021 at 12:01 PM #166519Try with this simple code for example:
123456789101112131415161718192021222324252627282930313233defparam cumulateorders=false//dummy strategyif rsi[14] crosses over 50 thenbuy 100000 contracts at marketendifset stop ploss 25SET TARGET PPROFIT tg//increase the array indexif not longonmarket and longonmarket[1] thenindex=index+1endif//compute the MFEif longonmarket thenmfe = max(mfe,high-tradeprice)$mfeArray[index] = mfeendif//at least 10 orders to allow the average calculationif isset($mfeArray[2]) thensum=0for i = 0 to index dosum=sum+$mfeArray[i]nextavg = sum/indexendifgraph avgOn backtest results MFe and MAE are generally Zero
And when you have MFE it’s over the Target …
Seems to have different bugs
04/08/2021 at 1:15 PM #166526 -
AuthorPosts
Find exclusive trading pro-tools on