- Search Forex Factory
- 27 Results (1 Thread , 26 Replies )
- Growler replied Jan 6, 2016
Hi Thank you all for assisting. I have solved it myself - unfortunately it took a little longer than I thought. First, there is nothing wrong with my code - not the names or the logic. However, to calculate MAE and MFE you have to calculate the ...
- Growler replied Jan 6, 2016
Hi Thank you for your comment, but I need to explain. First, I do not use an Alert as the output mechanism - it is for error identification only. It has to be in the loop else I could never see the calculations taking place, only the totals. You ...
- Growler replied Jan 6, 2016
Hi Abokwaik . Please read my mails. My code too is EXACTLY the same as the MT4 report, however, the details in that report are very light = no major stats. It is for this reason that I am writing this. For the record - ALL my code is mover 900 lines ...
- Growler replied Jan 6, 2016
Hi Abokwaik Yep, I also like to be specific. Have you read any of my replies? As I have said, I have tried that and it makes no difference - I have also tried that as isolated code. It is for this reason that I am sure there is something wrong with ...
- Growler replied Jan 6, 2016
Hi Abokwaik. Your OP_BUY and OP_SELL would work - or you could just use OrderType() < 2 which will only read true closed Buys and Sells
- Growler replied Jan 6, 2016
Thanks Abokwaik, but post 16 shows you that I am already doing it. I have refreshed the History because if I didn't the Positives would also be wrong and they are not
- Growler replied Jan 6, 2016
Hi Abokwaik Sorry I missed post 19. Actually, I have tried that exactly, but as I am calculating MAE and MFE (as well as Sharpe) I actually do a lot of work with an order. If you look at post 16 you will see that I am actually working with closed ...
- Growler replied Jan 6, 2016
Hi Abokwaik - you will see in post 16 that I have done all that - which works. If I hadn't done this the Positives wouldn't work either!
- Growler replied Jan 6, 2016
Hi Abokwaik. Thanks for the reply but I do not see your code - the one that you will quit over
- Growler replied Jan 6, 2016
Hi Vlad, If you look at post 16, I have added the other lines. Yes I certainly do use OrderHistory, I do zeroise the fields and yes, I do count 'forwards' through the orders as I want the latest first. I do this for comparison reasons.
- Growler replied Jan 6, 2016
Hi Vlad Sorry, I have still to answer you. Yes you are correct - the Tot does switch between positive and negative - depending on the orders. If you look at the screen shot you will see that Tot varies. To try ands stop this, I have tried making ...
- Growler replied Jan 6, 2016
Hi Gumrai If you read my earlier mail, you will see I have tried OrderProfit() with no change at all. I do not add 1 to OrdProfit - only to OrdProf - the number of orders. Also, it is not the Profit section that doesn't work - it is the Negative - ...
- Growler replied Jan 6, 2016
Hi Vlad. The count is simply an accumulation of the number of orders - it will always be positive.
- Growler replied Jan 6, 2016
Hi Vlad. Unfortunately, I cannot show the whole indicator - it is 900+ lines. However, the only parts missing are; TotalProf = 0.0; TotalLoss = 0.0; ..... for(x = HistTotal-1; x > 0; x--) { if(OrderSelect(x,SELECT_BY_POS,MODE_HISTORY) == false) { ...
- Growler replied Jan 6, 2016
Hi Vlad - Nope, the OrderProfit is still adding or subtracting when it wants to . The only thing I can say is that it is always the same orders. This leads me to believe that there is something embedded in the order that is doing this.
- Growler replied Jan 6, 2016
Hi - Just to clear the confusion, I have pasted a snapshot of the output - with the Alert, which as I say will go when I get this working.
- Growler replied Jan 6, 2016
Hi Vlad. The Alert is only there to try and sort this out - I will remove it when this works. When all orders are processed, I display the various lines using Objects, which is later down the code.
- Growler replied Jan 6, 2016
Hi Vlad - thanks. I have the following code just below it; TotalComm += OrdCommis; TotalSwap += OrdSwap; which is doing what you suggest. Which by the way works!
- Growler replied Jan 6, 2016
Hi FerruFX - thanks, but no as I want to see each order as it was processed. If I put it outside the loop I would only see the total. By being inside the loop I can see the maths per order - which is wrong. Thanks
- Growler replied Jan 6, 2016
Just out of curiosity - I have an indicator (this problem one) that calculates the MAE and MFE for all closed orders. When I get it working, I will post it.