Re: Using MyFxBook to analyse strategy entry and exit accuracy

What about average efficiency? Is it arithmetic average?

But this looks good.

Re: Using MyFxBook to analyse strategy entry and exit accuracy

The charts are from NT8 but docs from NT7. I'm sure they'll update the docs. There also other useful metrics we can implement.

Some of these calcs have to be made during the bakctest, however I'm afraid it will reduce the performance. I have idea how we can solve the problem - to separate the statistical calcs to two parts, main stats and additional stats. The main stats to be shown on the main screen. If you want more info, I'll make additional page where the program will make a new backtets and will fill up all stats. It makes sense because if the balance chart is pure, nobody cares about the stats.

http://s11.postimg.org/7kv8qe0r3/screenshot_927.jpg

I can add many stats screens in that "Analysis" page inspired from MT, NT, SQ...

Re: Using MyFxBook to analyse strategy entry and exit accuracy

Thanks Popov, now I'm clearer on how Entry and Exit accuracy are calculated.

So do you think you are going to incorporate these features (found in MyFxbook) into the next release?

1.  Entry and Exit accuracy
2.  Profit missed
3.  Time profitability

What are some of the likely new addition you think you would be adding for the next release?  Boy, I'm so excited and looking forward for it.  I bet, I'm not the only one here smile

Re: Using MyFxBook to analyse strategy entry and exit accuracy

Perhaps some of the analysis can be an addin or export

MAE and MFE would be super to be able to observe.

Re: Using MyFxBook to analyse strategy entry and exit accuracy

Popov wrote:

Hence, if you can separate the calculation into 2 parts, Opening conditions Accuracy and Closing Conditions Accuracy.  That would be awesome.

This was something I had in mind from the first day of FSB.

To test the entry, set the exit on Bar Closing and "Random Filter" as a Closing logic condition. After that press F5 to recalculate the strategy. It will give different performance on every hit.

Other option is to use "N bars exit". You need to preset it for 5 or 10 bars and to work on your entry rules. Or just change the number of bars by scrolling with the mouse wheel.

You can do the same with the exit rules. Set Bar Opening and Random Filter for entry and you'll see how good is your exit on a random entry.

From a FSB Pro point of view, everything is of "hindsight" hence, we already have all the historical data to do the kind of 100% accuracy that you mentioned Popov.

If we figure out a proper formula or method, I'm able to implement it in the program. Probably you can ask in the MyFxBook forum for clarification on the topic. I can add all info you find useful in MyFxBook in FSB Pro in next releases.


Hi Popov,

It's been sometime since our last discussion on this topic.  I understand that you would have a lot of thing in your plate.  Just curious whether you still have the intention to implement what we have discussed here in your "next" or future releases.

Re: Using MyFxBook to analyse strategy entry and exit accuracy

Yes, I have this features in my ToDo list.

Re: Using MyFxBook to analyse strategy entry and exit accuracy

Thanks for your kind consideration.

33 (edited by ahmedalhoseny 2016-04-29 23:01:23)

Re: Using MyFxBook to analyse strategy entry and exit accuracy

the elements are:
1-DDS : $   
2-DDS :No, of bars
3-Profit:$   
4-Profit:No, of bars
5-Profit Missed = (DDs + profit missed @ exit) : $
6-Profit Missed = (DDs + profit missed @ exit) :No, of bars
profit missed @ exit : its like the DDs but in the profitable side

Profit/ DDS($) % is a good measure but profit/ profit missed($) is best measure



Also using the no. of bars which means time is a very good measure and it will exclude the slow winning strategies from my portfolio allowing to allocate trading account to trade the best strategies
Lets take the Relay race 400X4 if we have a four fast strong runners '' Time factor'' you will break a new world record
So If we have the measure TIME IN PROFIT % = Profit bars / profit missed bars
using the time concept is something like giving you more time to trade again and only keeping you trade a profitable strategies in the minimum time

the picture shows two profitable portfolios 1st is 100% time used in one strategy and the second also 100% time used with triple profit " three strategies "

Post's attachments

time factor.png
time factor.png 5.43 kb, file has never been downloaded. 

You don't have the permssions to download the attachments of this post.

Re: Using MyFxBook to analyse strategy entry and exit accuracy

I may be relpying to an old thread, but I found the answer to how the entry and exit accuracy is calcualted :

Entry accuracy calculation
Buy trade: (Highest high – Entry price) / (Highest high – Lowest low)
Sell trade: (Entry price – Lowest low) / (Highest high – Lowest low)

Exit accuracy calculation
Buy trade: (Exit price – Lowest low) / (Highest high – Lowest low)
Short trade: (Highest high – Exit price) / (Highest high – Lowest low)

confirmed by myfxbook here in the comments

http://blog.myfxbook.com/2013/01/28/forex-trade-analytics-taking-it-to-the-next-level/

Re: Using MyFxBook to analyse strategy entry and exit accuracy

What's the status on this feature?

Re: Using MyFxBook to analyse strategy entry and exit accuracy

Hello all.

Is it effective to check indicators and watching live using MyFxbook?

Re: Using MyFxBook to analyse strategy entry and exit accuracy

I think that depends on how many strategies you may be running at once.....

FSBPro has a lot of analytic capabilities...... you do not really have to use something else unless you have a huge number of strategies running. You can update your data at the end of each day and check to see what happened and the metrics.

You will have to sorta explore and answer that one for yourself, we all have different ideas and interests.

Re: Using MyFxBook to analyse strategy entry and exit accuracy

Popov wrote:

This is quote of the NinjaTrader help guide:

Following are the formulas for the calculation of some of the efficiency performance graphs.

Assume the following:
- Enter long at price of 100
- Market moves down to a price of 90
- Market moves up to a price of 130
- Exit at a price of 110

Entry Efficiency is Calculated as:

(maximum price seen - entry price) / (maximum price seen - minimum price seen)
= (130 - 100) / (130 - 90)
= 75%
= The entry took 75% of the trade range

Exit Efficiency is Calculated as:

(exit price - minimum price seen) / (maximum price seen - minimum price seen)
= (110 - 90) / (130 - 90)
= 50%
= The exit took 50% of the available trade range

Total Efficiency is Calculated as:

(exit price - entry price) / (maximum price seen - minimum price seen)
= (110 - 100) / (130 - 90)
= 25%
= The trade represented only 25% of the trade range

   • The formulas are reversed for short
   • The blue line on any efficiency graph represents the average

What is the timespan for max/min price seen? It depends on perspective, correct? One could look back 100 bars or 10, but this means it's quite subjective to calculate accuracy?

Re: Using MyFxBook to analyse strategy entry and exit accuracy

footon wrote:
Popov wrote:

This is quote of the NinjaTrader help guide:

Following are the formulas for the calculation of some of the efficiency performance graphs.

Assume the following:
- Enter long at price of 100
- Market moves down to a price of 90
- Market moves up to a price of 130
- Exit at a price of 110

Entry Efficiency is Calculated as:

(maximum price seen - entry price) / (maximum price seen - minimum price seen)
= (130 - 100) / (130 - 90)
= 75%
= The entry took 75% of the trade range

Exit Efficiency is Calculated as:

(exit price - minimum price seen) / (maximum price seen - minimum price seen)
= (110 - 90) / (130 - 90)
= 50%
= The exit took 50% of the available trade range

Total Efficiency is Calculated as:

(exit price - entry price) / (maximum price seen - minimum price seen)
= (110 - 100) / (130 - 90)
= 25%
= The trade represented only 25% of the trade range

   • The formulas are reversed for short
   • The blue line on any efficiency graph represents the average

What is the timespan for max/min price seen? It depends on perspective, correct? One could look back 100 bars or 10, but this means it's quite subjective to calculate accuracy?

From the bar the trade enters to the bar the trade exits.

Re: Using MyFxBook to analyse strategy entry and exit accuracy

Hannes wrote:

From the bar the trade enters to the bar the trade exits.

What about having a better insight by determining whether entry has been late or early? Or does it complicate things too much? If only trade span is analyzed, only late entry contributes to inaccuracy, doesn't it? But a strategy can be an early entrant in addition to late entrant. Would like to hear everyone's opinion on this.

41 (edited by footon 2017-12-27 20:44:42)

Re: Using MyFxBook to analyse strategy entry and exit accuracy

Ladies and gents, this is my take on accuracy. I used the formulas provided above. Any feedback is appreciated.
------
Some bugs appeared, more work has to be done.

Re: Using MyFxBook to analyse strategy entry and exit accuracy

footon -- this may be a distraction, for which I apologize -- but I can't help myself.  Plus, you said any feedback was appreciated...

I wrote in a previous thread about MT4 missing trades -- this was an observation initially reported by alamehmazen123 and also confirmed by myself when we were testing Portfolio Maker.  My guess is this phenomenon is caused by an MT4 that is starved for resources and does not allocate time-slices equally among the multiple threads it creates.  Every chart and OnTick runs in its own thread.  In addition, there are higher priority threads -- like retrieving broker data, processing orders, etc.

I believe the missing trades may be due to missing exits -- e.g. SL or TP -- since these are affected by each call to OnTick, and missing ticks can cause your strategy to miss a SL or TP exits.  If a strategy does not use SL or TP then this may not be an issue -- because OHLC bar data doesn't change during the time period.  However, SL and TP are affected by OnTick and if ticks are missed then this can really affect how your strategy performs.  Do you know what I mean?

So -- my point is this.  Given that MT4 performance issues can influence how a strategy performs, then I've begun to question whether it is really worthwhile to spend a lot of time refining every last detail about a strategy.  I definitely do value statistics and rely on them a lot.  But after Popov's software does its thing of generating and training a strategy and I do some pruning to exclude poor-performers (based on statistics) from a portfolio, then I wonder whether spending more time attempting to further refine a strategy's statistics or worrying about accuracy is worth it -- considering MT4 performance issues can render these refinements irrelevant.

I do not have any data to back this up -- other than the observations.  I'm just putting it out there as something to consider.

Re: Using MyFxBook to analyse strategy entry and exit accuracy

Fixed it!

Post's attachments

AccountStatistics.cs 28.75 kb, 14 downloads since 2017-12-27 

You don't have the permssions to download the attachments of this post.

Re: Using MyFxBook to analyse strategy entry and exit accuracy

sleytus, certainly mt (=broker) plays a big part in winning or losing, there's no doubt about it. That's why I try to calm people down on 99% things and backtesting strats to death on both programs. SL/TPs can't be missed, not in the way you describe them because TPs and SLs are set on the trading server. This means if you have an opened trade with TP and SL and your terminal goes down, position will still get closed if either of them is reached. So, the problem in mismatches lies somewhere else. It can be a difficult task to locate the problem but it it's quite useful to know. It might as well be that the portfolio expert is too resourceful - what is at fault in this case, the terminal itself or the computer which runs it? Sorry for my ignorance, but your portfolio maker just compiles separate experts into one? If so, there's plenty of scope to optimize the code and make it "slimmer" or easier to run resource-wise than the experts separately on separate charts.

Accuracy - I respect your opinion, but it does have its virtues. A bit of a heads-up for users - most probably you'll not see accuracies higher than 65%. It's a distribution thing.

Thank you again for your feedback, that's the point of forums after all - to bounce ideas in civil manner smile Early morning hours for me, kinda shot after a very long day, hopefully my rambling is understandable smile

45 (edited by hannahis 2017-12-28 05:46:54)

Re: Using MyFxBook to analyse strategy entry and exit accuracy

footon wrote:

Fixed it!

Hi Footon,

Thanks for reviving this old forgotten topic that much needed to be addressed, the benefits of exploring how we could make good use of the metric for better Strategy selection and improvements.

Glad you provide us the Account File, attached.

For the benefits of new users.  You can attach this file in FSB Pro. 

Go to "User File Folder" and look for "Code" and You replace the old file with this one.  (You can save the old file in another file name just in case you want to revert your actions).  I hope I got these steps right.


Footon, after I replace the Account Statistics with the new one, I don't noticed any difference from the previous version.  Could you kindly advise, what changes you have added and where or which metric is therefore being "improved or altered"?


Popov, can we therefore use it as an Acceptance Criteria or Statistic for Generating or Optimizing the Strategies.  It would be wonderful if we can use this metric as our Criteria search (and that would be a step closer to my wish/dream that I've been waiting all these years).  Imagine, Optimizing my EA's opening and closing conditions to be more accurate.  And Generating EA that have excellent opening and closing conditions (i.e. High entry/exit accuracy), that would be so cool.

Thanks for your efforts and helping us out all these years with your indicators and improvements.  Really appreciate your years of dedications and support.

Re: Using MyFxBook to analyse strategy entry and exit accuracy

footon -- excellent response, thank you.  BTW -- you never ramble -- your posts are always clear and very articulate. 

I did have a misconception about how SL/TP worked and your explanation is a great help -- thanks.  And it also raised another question.  If SL/TP doesn't rely on receiving OnTick events and if OHLC bar data is updated only once at the beginning of a period, then why do our strategies even bother with handling every OnTick event?  I mean, why wouldn't a strategy check if there is a new bar and, if not, then immediately return?  If a strategy could ignore all OnTick events --
except when there is new bar data -- then it seems like it would save the CPU from performing a lot of unnecessary computations.

Regarding mismatches in trades -- alamehmazen123 and I have tried poking around but weren't able to come up with anything definitive -- other than it is readily reproducible.  I've sort of given up on using Portfolio Maker in a live account and only use it for back testing large numbers of FSB-generated strategies.  Since I like working with portfolios then I've returned to using EA Studio.  But EA Studio-generated portfolios may also have a problem.  Within a portfolio all the strategies DO seem to trade similarly (unlike the portfolio created by Portfolio Maker).  However, the exact same EA Studio-generated strategy running alone and attached to its own chart again trades more frequently (e.g. perhaps twice as many trades) compared to its twins running in a portfolio EA.  In a different thread I attached a zip file with multiple copies of a cloned strategy (with different magic numbers) in case anyone else was interested in verifying this for themself.

I'm not sure where to go with this.  For now I think I'm settling in on using EA Studio exclusively.  I really like what Popov has done.  But when I feel more motivated I would like to insert some diagnostic code in the hope of better understanding why identical strategies don't trade identically in MT4.

Re: Using MyFxBook to analyse strategy entry and exit accuracy

Hannah There is a checkbox under Control Panel -> Custom Code called "Load custom account statistics at startup" that needs to be checked. Then turn attention to the stat box on the right in FSB, you should see accuracy stats straight away.
---
sleytus Strats need to handle every tick because that's often the case to make them work as intended. For instance, if opening/closing point is a MA value, it means opening or closing can occur through the whole life cycle of a bar. Strict bar open/bar close strats can be optimized in a way, on the other hand bar closing is bit of an abstract approach of sensing the close of a bar because bar close is not raised as an event in MT, every tick is a close price. Long story short - we need those ticks, it's the best and most reliable model to date.

Mismatching trades in portfolios is a huge problem! If there is a difference in trades, then it renders the whole process of strategy development useless. All conclusions, inferences and reasonable expectations for a strategy or a set of strategies will be not met as the strats will behave a lot differently than in the backtest. All work will be invalidated and there's just a bunch of random garbage, same as throwing sht on the wall and then seeing after the fact if something stuck on it or not. Hmm, I'll try to look into it.

Re: Using MyFxBook to analyse strategy entry and exit accuracy

https://s9.postimg.org/ya6sbxa8b/mt4-charts-uneven-trading.png

Thanks for your offer to look into this.  So far only alamehmazen123 and myself have shown any interest.

The image above shows 20 identical EAS-generated strategies -- each attached to their own EURUSD M1 chart.  In a separate thread (https://forexsb.com/forum/post/48265/#p48265) I attached a *.zip file that included these 20 strategies.  Again, these strategies are identical, with the exception I assigned different magic numbers so I could track them.

These same, exact 20 strategies, when bundled in a EAS-generated portfolio do trade almost identically -- which is good.  However, the number of trades within the portfolio is less than the number of trades when attached to their own chart -- by about a factor of 2.

I wouldn't go so far as to say this type of mismatching renders strategy development useless -- we still need strategies with a good probability of succeeding.  But this result did make me feel somewhat discouraged -- hence my earlier post in this thread.  I mean, when MT4's behavior exhibits this type of unpredictability then it sort of dampens my enthusiasm for spending a lot of time refining strategies because MT4 introduces trading irregularities that I have no way of compensating for.

Re: Using MyFxBook to analyse strategy entry and exit accuracy

https://s9.postimg.org/o1eb649bv/portfolio-trading-20171208.png

Another image that displays the same problem, but from a different perspective.  In this case there are 20 FSB-generated strategies and they are NOT identical.  The odd-numbered strategies are attached to their own chart.  The even-numbered strategies are bundled in a Portfolio Maker-generated portfolio EA.  Ignore strategy 11000.  Strategies 11001 and 11002 are identical -- 11001 trades in in own chart and 11002 trades within the portfolio EA.  The other pairs are [11003,11004], [11005,11006], and so on.

Scanning down the column, you can see that the odd-numbered strategies (which trade in their own chart) trade more frequently than their even-numbered twin (which trades within the portfolio EA).  This phenomenon might be real or, as you pointed out earlier, could be an artifact of how Portfolio Maker bundles FSB-generated strategies.

However, scan down the column and pay attention to only the odd-numbered strategies which trade in their own chart.  You can see that as you go from strategy 11001, to 11003, to 11005, to ...11039 the number of trades decreases.  Since these strategies are not identical then this could just be a coincidence.  But, I suspect not.  Since each chart trades in its own thread and since MT4 creates a new thread each time it calls a chart's OnTick handler (I believe), then I wonder whether this observation simply reflects how MT4 handles threads with different priorities when resources and timing are limited.

Re: Using MyFxBook to analyse strategy entry and exit accuracy

footon wrote:

Strats need to handle every tick because that's often the case to make them work as intended.

If I only use a 'Base price' of Open or Close, does that statement still apply?

it means opening or closing can occur through the whole life cycle of a bar.

This is really interesting -- but what exactly does an indicator look at during the life cycle of a bar?  I assumed that Open and Close only change at each new time period (i.e. with each new bar).  I've wondered whether High and Low might be changing with each tick, but somewhere I read they don't.  I understand that Ask and Bid do change with each tick, but our strategies don't use those values when deciding whether or not to generate a signal.  Or do they?

Please correct me -- the only data we have to work with is OHLC, Ask and Bid.  OHLC gets updated once with each new bar.  Ask and Bid can change with each tick.  During a bar's interval, when it receives many ticks, then what data is changing that would cause a strategy to generate a signal?

Related to this -- some of my strategies use 'Bar Opening' and 'Bar Closing'.  When I trade on the H4 time period then those strategies open and close trades only at 4-hour time periods, which suggests they do not use data accompanying each tick.


Thanks...