Coding help - page 500

 

mladen,

My intentions were not to use the OrderClose() in the indicator. What i was refering to was that the script has a sequence in closing the trades, which is from the first placed trades to the last. My suggestion was, that if it can be done in script to tell the script to go in that order, if it isn't possible to tell an indicator to display the orders in that same sequence.....which is what i was trying to achieve with the P&L indicator i posted. It would make it easier to keep track and monitor your newer trades, for the reason that they will be displayed in the correct sequence, from most recent on bottom and older trades on top.

 
Blueboyblue:
mladen, My intentions were not to use the OrderClose() in the indicator. What i was refering to was that the script has a sequence in closing the trades, which is from the first placed trades to the last. My suggestion was, that if it can be done in script to tell the script to go in that order, if it isn't possible to tell an indicator to display the orders in that same sequence.....which is what i was trying to achieve with the P&L indicator i posted. It would make it easier to keep track and monitor your newer trades, for the reason that they will be displayed in the correct sequence, from most recent on bottom and older trades on top.

Blueboyblue

According to metatrader, reading orders using the position index does not guarantee any particular order as far as order(s) open times are concerned. You have to create a 2 dimensional array list of orders containing order open times and order tickets, sort that array using the open times as the sorting key and then read the orders using ticket numbers stored in that already sorted array

Changing the index direction of the loop when accessing orders by position will not produce expected results (at least that is what metatrader is telling as an official information)

 

hello mladen

could you fix the coding errors in the attached

Files:
e-stochfree.mq4  10 kb
 

mladen,

The script i posted is for use on a broker with first in, first out rules. That means that the script has to decide which trades were placed first. And it works fine. Im just confused why this isn't possible in an indicator but the command is possible in this script.

Does the script not have that type of command?

 
candyman752:
hello mladen could you fix the coding errors in the attached

candyman752

Here you go : e-stochfree_1.mq4

Files:
 

hello mladen

please help with compiling errors on the below. By any chance do you have suggestion for any good combined stochatic RSI MTF EAs

Files:
 
Blueboyblue:
mladen,

The script i posted is for use on a broker with first in, first out rules. That means that the script has to decide which trades were placed first. And it works fine. Im just confused why this isn't possible in an indicator but the command is possible in this script.

Does the script not have that type of command?

Blueboyblue

Please read this post : https://www.mql5.com/en/forum/174385/page333

That is the only foolproof solution for a list that will be sorted by order open times - and even then the assumption that a higher ticket number means later opening time must be made - which foes not need to be true at all

You already experienced some problems that can happen when it is not done that way (that script too can not guarantee the FIFO rule at all)

 

Thats a bummer...Would you happen to have the updated version of the currency power meter? The one i have has an error on the updated Mt4 platform.

Files:
 
Blueboyblue:
Thats a bummer...Would you happen to have the updated version of the currency power meter? The one i have has an error on the updated Mt4 platform.

Blueboyblue, there's one here: https://www.mql5.com/en/forum/174385/page331

 

Thanks a lot Mrtools. This one is working just fine.

Reason: