If you don't show your own code attempting to do what you want, then we will just assume that you don't know how to code at all.
And if that is the case, we will just tell you to hire someone to code it for you (quick but costs money), or to put in the effort to learn to code yourself (does not cost money but will take many months, maybe longer).
If you don't show your own code attempting to do what you want, then we will just assume that you don't know how to code at all.
And if that is the case, we will just tell you to hire someone to code it for you (quick but costs money), or to put in the effort to learn to code yourself (does not cost money but will take many months, maybe longer).
this my code :
<Deleted. Edit your post and format your code properly using the "Alt-S" or by clicking the code Icon "</>" in the posting toolbar.>
but cant work for read 4 from 10 buys position with highest profit
Please re-edit your post and format your code properly using the "Alt-S" or by clicking the code Icon "</>" in the posting toolbar.
Also please explain what you are doing in your code because it does not seem to do what you explained you want it to do. You seem to just be adding the profit of 4 orders but don't even check if there are open trades or not.
- Use "OrdersTotal()" to obtain the count of currently open positions.
- Create an array of this maximum size base on the above count
- Create an index variable for the array and set it to an initial value of "0".
- Loop through all the open positions using "OrderSelect()" to select them.
- Filter by symbol "OrderSymbol()", magic number "OrderMagicNumer()" and if necessary, by type "OrderType()".
- Obtain the profit for the position using "OrderProfit()".
- Save the profit value in the array at the current array index, and increment the array index variable.
- After the loop is concluded, sort the array, in descending order with with "ArraySort()", based on the count obtained from the array index variable.
- Create a new variable for the total profit and set it to an initial value of "0.00".
- Loop through the first 4 (or less based on array index count) elements of the array, and add the value to the total profit variable.
- Use "OrdersTotal()" to obtain the count of currently open positions.
- Create an array of this maximum size base on the above count
- Create an index variable for the array and set it to an initial value of "0".
- Loop through all the open positions using "OrderSelect()" to select them.
- Filter by symbol "OrderSymbol()", magic number "OrderMagicNumer()" and if necessary, by type "OrderType()".
- Obtain the profit for the position using "OrderProfit()".
- Save the profit value in the array at the current array index, and increment the array index variable.
- After the loop is concluded, sort the array, in descending order with with "ArraySort()", based on the count obtained from the array index variable.
- Create a new variable for the total profit and set it to an initial value of "0.00".
- Loop through the first 4 (or less based on array index count) elements of the array, and add the value to the total profit variable.
Thank You Very Much for ur explain...i will try the algoritm
Please do as you were asked.
Please re-edit your post and format your code properly using the "Alt-S" or by clicking the code Icon "</>" in the posting toolbar.
Please do as you were asked.
ok thank you
And yet, you still did not correct your post and properly format the code! Don't expect any further help until you comply.
And yet, you still did not correct your post and properly format the code! Don't expect any further help until you comply.
still get solution, i have not right code now
Respect the rules of the forum and fix your post!
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
Helllo everyone, i need your help,
How script/ function to filter profit, example :
I Have 10 Buys Open Position. I need to calculate 4 Buys open Position with highest profits.
Thank You