I have no idea what you are talking about. I have tried to recreate the problem --- I failed. It worries me if someone says that my code works "a little bit". As if it would make up its own mind whether it will work today or not. There is no such thing.
I would like to get an example of a set-file, where it only works "a little bit".
Chart into alphabetic order script
- SteveHopwood
- Owner
- Posts: 9904
- Joined: Tue Nov 15, 2011 8:43 am
- Location: Misterton - an insignificant village in England. Very pleasant to live in.
Chart into alphabetic order script
Most of us will settle for your code working 'a little bit'.renexxxx » Fri Mar 09, 2018 12:14 am wrote:I have no idea what you are talking about. I have tried to recreate the problem --- I failed. It worries me if someone says that my code works "a little bit". As if it would make up its own mind whether it will work today or not. There is no such thing.
I would like to get an example of a set-file, where it only works "a little bit".
It does tend to work magnificently all of the time.
You get my message?
Read the effing manual, ok?
Afterprime is the official SHF broker. Read about them at https://www.stevehopwoodforex.com/phpBB3/viewtopic.php?p=175790#p175790.
I still suffer from OCCD. Good thing, really.
Anyone here feeling generous? My paypal account is always in the market for a tiny donation. pianodoodler@hotmail.com is the account.
To see The Weekly Roundup of stuff you guys might have missed Click here
My special thanks to Thomas (tomele) for all the incredible work he does here.
Afterprime is the official SHF broker. Read about them at https://www.stevehopwoodforex.com/phpBB3/viewtopic.php?p=175790#p175790.
I still suffer from OCCD. Good thing, really.
Anyone here feeling generous? My paypal account is always in the market for a tiny donation. pianodoodler@hotmail.com is the account.
To see The Weekly Roundup of stuff you guys might have missed Click here
My special thanks to Thomas (tomele) for all the incredible work he does here.
- renexxxx
- Trader
- Posts: 860
- Joined: Sat Dec 31, 2011 3:48 am
Chart into alphabetic order script
Thanks Steve for your vote of confidence!
Despite that, I did find a little problem in the code (which by the way has nothing to do with the problem reported by Schmurex, as he/she wanted the symbols on IncludeSymbols not to be sorted). The problem was with the sorting. Turns out that MQL4 built-in function ArraySort() can not sort string-arrays (only numeric ones). So, I have created an new version of ArraySort(), called myArraySort() that can hopefully sort an array of any singular type (i.e. that excludes STRUCTs and CLASSes):
A new OpenChartsv1.1.mq4 is attached.
Despite that, I did find a little problem in the code (which by the way has nothing to do with the problem reported by Schmurex, as he/she wanted the symbols on IncludeSymbols not to be sorted). The problem was with the sorting. Turns out that MQL4 built-in function ArraySort() can not sort string-arrays (only numeric ones). So, I have created an new version of ArraySort(), called myArraySort() that can hopefully sort an array of any singular type (i.e. that excludes STRUCTs and CLASSes):
Code: Select all
template<typename T>
void myArraySort(T &array[], bool ascending=true) {
T temp;
for(int i=0; i < ArraySize(array)-1; i++) {
for(int j=i+1; j < ArraySize(array); j++) {
if ( ( ascending && ( array[i] > array[j])) ||
(!ascending && ( array[i] < array[j])) ) {
// Swap array[i] with array[j]
temp = array[j];
array[j] = array[i];
array[i] = temp;
}
}
}
}You do not have the required permissions to view the files attached to this post.
- SteveHopwood
- Owner
- Posts: 9904
- Joined: Tue Nov 15, 2011 8:43 am
- Location: Misterton - an insignificant village in England. Very pleasant to live in.
Chart into alphabetic order script
A Bubble sort.renexxxx » Fri Mar 09, 2018 1:21 am wrote:Thanks Steve for your vote of confidence!
Despite that, I did find a little problem in the code (which by the way has nothing to do with the problem reported by Schmurex, as he/she wanted the symbols on IncludeSymbols not to be sorted). The problem was with the sorting. Turns out that MQL4 built-in function ArraySort() can not sort string-arrays (only numeric ones). So, I have created an new version of ArraySort(), called myArraySort() that can hopefully sort an array of any singular type (i.e. that excludes STRUCTs and CLASSes):
Code: Select all
template<typename T> void myArraySort(T &array[], bool ascending=true) { T temp; for(int i=0; i < ArraySize(array)-1; i++) { for(int j=i+1; j < ArraySize(array); j++) { if ( ( ascending && ( array[i] > array[j])) || (!ascending && ( array[i] < array[j])) ) { // Swap array[i] with array[j] temp = array[j]; array[j] = array[i]; array[i] = temp; } } } }
A new OpenChartsv1.1.mq4 is attached.
This takes me right back to the start of my programming in 1984. I used the proceeds from a huge concerto performance to buy my first computer and printer - a few quid short of £1,000.
It was a BBC 'B' - there will be a few oldies nodding nostalgically right now. 32K (yes, "K") of RAM and programmed in the low level language BBC Basic. This did not compile and so each command had to be translated into machine code every time it was operated. Code was stored on a cassette recorder - it was a year before the first external disk drive became available - 5.5 inch floppy.
There were no inbuilt sorting functions, so a hand-crafted Bubble sort was the only one available. The thing was so slow that a database of c.30 records would take 5 minutes to sort.
Happy days.
Read the effing manual, ok?
Afterprime is the official SHF broker. Read about them at https://www.stevehopwoodforex.com/phpBB3/viewtopic.php?p=175790#p175790.
I still suffer from OCCD. Good thing, really.
Anyone here feeling generous? My paypal account is always in the market for a tiny donation. pianodoodler@hotmail.com is the account.
To see The Weekly Roundup of stuff you guys might have missed Click here
My special thanks to Thomas (tomele) for all the incredible work he does here.
Afterprime is the official SHF broker. Read about them at https://www.stevehopwoodforex.com/phpBB3/viewtopic.php?p=175790#p175790.
I still suffer from OCCD. Good thing, really.
Anyone here feeling generous? My paypal account is always in the market for a tiny donation. pianodoodler@hotmail.com is the account.
To see The Weekly Roundup of stuff you guys might have missed Click here
My special thanks to Thomas (tomele) for all the incredible work he does here.
-
schmurex
Chart into alphabetic order script
Hi Renexxxx,renexxxx » Thu Mar 08, 2018 5:14 pm wrote:I have no idea what you are talking about. I have tried to recreate the problem --- I failed. It worries me if someone says that my code works "a little bit". As if it would make up its own mind whether it will work today or not. There is no such thing.
I would like to get an example of a set-file, where it only works "a little bit".
Sorry for my late reply, I just found yours.
I didn't mean to offense you, as I highly respect you as a coder and a member of this community.
I tried many times and got each time a different result, always differing to some extend from the list: most of the times misplaced pairs, sometime simply missing pairs.
I believe that it's not a problem of code but a problem with Empty4 when it has to deal with too many charts.
I tried on 2 different computers both with Windows 10, one with Global Prime, the other one with FxPro.
Some of the indexes as well as the metals have different name in different platforms.
Here are 2 Set files.
You do not have the required permissions to view the files attached to this post.
- renexxxx
- Trader
- Posts: 860
- Joined: Sat Dec 31, 2011 3:48 am
Chart into alphabetic order script
Don't worry about offending me ...
I have tried your GP set file on my GP platform and the charts are opened in exactly the same order as specified in the set file. I have not tried the FX Pro set file, as I don't have a FX Pro terminal.
I give up and I declare this discussion now closed. It doesn't add anything to the forum. You have to sort out your problem as it is clearly on your end.
I have tried your GP set file on my GP platform and the charts are opened in exactly the same order as specified in the set file. I have not tried the FX Pro set file, as I don't have a FX Pro terminal.
I give up and I declare this discussion now closed. It doesn't add anything to the forum. You have to sort out your problem as it is clearly on your end.
-
schmurex
Chart into alphabetic order script
I completely agree with you. No problem at all.
Thanks again
Thanks again
- renexxxx
- Trader
- Posts: 860
- Joined: Sat Dec 31, 2011 3:48 am
Chart into alphabetic order script
Yes, bubble sort is not the most efficient sorting algorithm. In the attached script, I compare the time it takes to sort a 50000 element doubles array via bubble sort and quick sort. The difference in time is astounding!
For those interested: normally quicksort is implemented recursively. However, on Empty4 this gives a stack overflow (for reasonably sized arrays). Therefore, I've implemented an iterative version of quicksort.
This is just for fun ... doesn't make any money!
You do not have the required permissions to view the files attached to this post.
-
1000pips
- Trader
- Posts: 29
- Joined: Fri Jun 03, 2016 11:13 am
Chart into alphabetic order script
:youknow: Hi Renexx, thank you for the script. Doing semi automated trading & was wondering is there a script for copying line values with tags into values transferable into excel like
{PAIR, EASYORDER_Price, EASYORDER_SL. EASYORDER_TP, TP2} as comma separated values that you copy from the open script window & manually transfer all at once into excel, as long as you assign the tags of the line prices you want the script to copy. I am trade sizing in Excel the manual way. Thank you for your assistance.
{PAIR, EASYORDER_Price, EASYORDER_SL. EASYORDER_TP, TP2} as comma separated values that you copy from the open script window & manually transfer all at once into excel, as long as you assign the tags of the line prices you want the script to copy. I am trade sizing in Excel the manual way. Thank you for your assistance.