• Home
  • Forums
  • Trades
  • News
  • Calendar
  • Market
  • Brokers
  • Login
  • Join
  • User/Email: Password:
  • 4:00am
Menu
  • Forums
  • Trades
  • News
  • Calendar
  • Market
  • Brokers
  • Login
  • Join
  • 4:00am
Sister Sites
  • Metals Mine
  • Energy EXCH
  • Crypto Craft

Options

Bookmark Thread

First Page First Unread Last Page Last Post

Print Thread

Similar Threads

Recent Candles indicator 231 replies

Trading profitably using Recent Strength 58 replies

Recent Strength indicator 0 replies

Great recent strength indicator needs alert 0 replies

Recent Strength Idea 3 replies

  • Platform Tech
  • /
  • Reply to Thread
  • Subscribe
  • 314
Attachments: Recent Strength indicator
Exit Attachments
Tags: Recent Strength indicator
Cancel

Recent Strength indicator

  • Last Post
  •  
  • 1 1718Page 192021 44
  • 1 18Page 1920 44
  •  
  • Post #361
  • Quote
  • Nov 3, 2011 11:14pm Nov 3, 2011 11:14pm
  •  BankRobber
  • | Commercial Member | Joined May 2011 | 87 Posts
Here is my Currency Strength Meter for NinjaTrader

http://img24.imageshack.us/img24/822...etterrenko.jpg


 
 
  • Post #362
  • Quote
  • Edited 9:17am Nov 5, 2011 9:00am | Edited 9:17am
  •  pedma
  • Joined Jan 2010 | Status: Member | 363 Posts
Hi David,

Thanks a lot for your indicators. Unfortunately, it's too heavy for my slow computer .... May I ask you to modify the recent strength indicator for me, so it's just showing 2 strongest & 2 weakest currency in all TF (M1 - D1) ? I send you an image as attachment. The first row is the STRONGEST currency, below it is the WEAKEST currency. Followed by the SECOND STRONGEST and SECOND WEAKEST currency.

With this example, I will choose currency for trading like this :
If I trade at M30 TF, I will trade : AUD-USD or AUD-JPY or GBP-USD or GBP-JPY.
And if I want to trade at H1 TF, I will choose : CAD-GBP or CAD-EUR or JPY-GBP or JPY-EUR.

Thank you very much David,
-pedma-
Attached Image (click to enlarge)
Click to Enlarge

Name: Strongest-Weakest.jpg
Size: 44 KB
Good friends are more valuable than gold ...
 
 
  • Post #363
  • Quote
  • Nov 5, 2011 6:48pm Nov 5, 2011 6:48pm
  •  hanover
  • Joined Sep 2006 | Status: ... | 8,092 Posts
Quoting pedma
Disliked
Hi David,

Thanks a lot for your indicators. Unfortunately, it's too heavy for my slow computer .... May I ask you to modify the recent strength indicator for me, so it's just showing 2 strongest & 2 weakest currency in all TF (M1 - D1) ? I send you an image as attachment. The first row is the STRONGEST currency, below it is the WEAKEST currency. Followed by the SECOND STRONGEST and SECOND WEAKEST currency.

With this example, I will choose currency for trading like this :
If I trade at M30 TF, I will trade : AUD-USD or AUD-JPY...
Ignored
Pedma,

The slowness is caused by the vast amount data that the indicator has to gather from the br0ker's server, from every pair, on every timeframe, just to calculate the values. Hence simplifying the presentation would not solve your slowness problem.

In nay case, I am sorry, now that I'm working full time, I am too busy to undertake more programming work.

Perhaps the indicator attached to post #56 is more to your liking, although it shows daily strength only.

David
 
 
  • Post #364
  • Quote
  • Nov 5, 2011 10:02pm Nov 5, 2011 10:02pm
  •  pedma
  • Joined Jan 2010 | Status: Member | 363 Posts
Quoting hanover
Disliked
Pedma,

The slowness is caused by the vast amount data that the indicator has to gather from the br0ker's server, from every pair, on every timeframe, just to calculate the values. Hence simplifying the presentation would not solve your slowness problem.

In nay case, I am sorry, now that I'm working full time, I am too busy to undertake more programming work.

Perhaps the indicator attached to post #56 is more to your liking, although it shows daily strength only.

David...
Ignored
Hi David,

Thanks a lot for all you have done .... I will see the link you gave.
Hope you are always happy .... .. always have green pips ....

Best Regards,
-pedma-
Good friends are more valuable than gold ...
 
 
  • Post #365
  • Quote
  • Nov 6, 2011 12:19pm Nov 6, 2011 12:19pm
  •  pedma
  • Joined Jan 2010 | Status: Member | 363 Posts
Quoting hanover
Disliked
Pedma,

The slowness is caused by the vast amount data that the indicator has to gather from the br0ker's server, from every pair, on every timeframe, just to calculate the values. Hence simplifying the presentation would not solve your slowness problem.

In nay case, I am sorry, now that I'm working full time, I am too busy to undertake more programming work.

Perhaps the indicator attached to post #56 is more to your liking, although it shows daily strength only.

David...
Ignored
Hi David,

If I try to catch the value of "Recent Strength" using iCustom, is it possible ?

May be like :

double USD_M1,USD_M5,USD_M15, ...., EUR_M1,EUR_M5,EUR_M15, ....

USD_M1=iCustom(NULL,1,"Recent Strength",0,0);
USD_M5=iCustom(NULL,5,"Recent Strength",0,0);
USD_M15=iCustom(NULL,15,"Recent Strength",0,0);

EUR_M1=iCustom(NULL,1,"Recent Strength",1,0);
EUR_M5=iCustom(NULL,5,"Recent Strength",1,0);
EUR_M15=iCustom(NULL,15,"Recent Strength",1,0);

Then I try to compare the value of USD_M1 with EUR_M1 , USD_M5 with EUR_M5, etc ...
or using ArraySort to sort the value from Small to Big.

Is it possible ? If yes, which buffer belongs to which Currency (I mean at above example: USD = buffer 0, EUR = buffer 1, etc ... ) ?

Thanks
-pedma-
Good friends are more valuable than gold ...
 
 
  • Post #366
  • Quote
  • Nov 6, 2011 5:22pm Nov 6, 2011 5:22pm
  •  Rascacio
  • | Joined Feb 2010 | Status: Member | 241 Posts
Hi Hanover, I am currently using Steve Hopwoods Hanover EA and am about to try some of the other EA's that have been 'Hanovered' but I would like to know if it is possible to remove some of the currencies from the 'Build Strength Preset File' without cocking up the 'Recent Strength Ex4' file ?

The main reason being that I have an aversion to JPY and CHF at the moment, after being burned too often by them !!!!

Any guidance would be greatly appreciated.

Cheers.
 
 
  • Post #367
  • Quote
  • Nov 7, 2011 2:35am Nov 7, 2011 2:35am
  •  hanover
  • Joined Sep 2006 | Status: ... | 8,092 Posts
Quoting Rascacio
Disliked
Hi Hanover, I am currently using Steve Hopwoods Hanover EA and am about to try some of the other EA's that have been 'Hanovered' but I would like to know if it is possible to remove some of the currencies from the 'Build Strength Preset File' without cocking up the 'Recent Strength Ex4' file ?

The main reason being that I have an aversion to JPY and CHF at the moment, after being burned too often by them !!!!

Any guidance would be greatly appreciated.

Cheers.
Ignored
Hi Rascacio,

I'm not 100% conversant with how the Hanover EA operates, hence I would be very hesitant to remove currencies from the RS output. Perhaps you could politely ask Steve to enable a currency selection facility in the EA?

David
 
 
  • Post #368
  • Quote
  • Nov 7, 2011 2:49am Nov 7, 2011 2:49am
  •  hanover
  • Joined Sep 2006 | Status: ... | 8,092 Posts
Quoting pedma
Disliked
Hi David,

If I try to catch the value of "Recent Strength" using iCustom, is it possible ?

May be like :

double USD_M1,USD_M5,USD_M15, ...., EUR_M1,EUR_M5,EUR_M15, ....

USD_M1=iCustom(NULL,1,"Recent Strength",0,0);
USD_M5=iCustom(NULL,5,"Recent Strength",0,0);
USD_M15=iCustom(NULL,15,"Recent Strength",0,0);

EUR_M1=iCustom(NULL,1,"Recent Strength",1,0);
EUR_M5=iCustom(NULL,5,"Recent Strength",1,0);
EUR_M15=iCustom(NULL,15,"Recent Strength",1,0);

Then I try to compare the value of USD_M1 with EUR_M1 , USD_M5 with EUR_M5,...
Ignored
Pedma,

It is better to have your EA read the OutputFile that can be generated by the RS indy (see OutputFile parameter info in post #1), that to attempt to use iCustom().

You can use the attached code shell to have your EA read the file into more easily referenced arrays. More info here.

Most of the functions in the 'FUNCTIONS LIBRARY' section are not used. You can delete any functions that cause a warning error ("function xxx is not referenced and will be removed from exp-file") from the .mq4 file if you wish.

Good luck,
David
Attached File(s)
File Type: mq4 test1.mq4   93 KB | 785 downloads
 
 
  • Post #369
  • Quote
  • Nov 7, 2011 3:09am Nov 7, 2011 3:09am
  •  Rascacio
  • | Joined Feb 2010 | Status: Member | 241 Posts
Quoting hanover
Disliked
Hi Rascacio,

I'm not 100% conversant with how the Hanover EA operates, hence I would be very hesitant to remove currencies from the RS output. Perhaps you could politely ask Steve to enable a currency selection facility in the EA?

David
Ignored
Thank's David. I will make a polite request to Steve later today !!!
 
 
  • Post #370
  • Quote
  • Nov 7, 2011 6:38am Nov 7, 2011 6:38am
  •  FxHope
  • | Joined Sep 2010 | Status: Member | 69 Posts
I appreciate your work thanks

I want to offer another column in RS indi, independent from TF. I do not think we should calculate the average of all TF for any currency. But to find a scale that would give strength in Current real time. It seems to me that we could get more definite reference for weak and strong currency.
I do not have a clear idea of what type of scale we need. So I bring this up here.
Thank you
FxHOP
 
 
  • Post #371
  • Quote
  • Edited Nov 8, 2011 12:44am Nov 7, 2011 3:43pm | Edited Nov 8, 2011 12:44am
  •  hanover
  • Joined Sep 2006 | Status: ... | 8,092 Posts
Quoting FxHope
Disliked
I appreciate your work thanks

[font=Arial][color=#333333]I want to offer another column in RS indi, independent from TF. I do not think we should calculate the average of all TF for any currency. But to find a scale that would give strength in Current real time. It seems to me that we could get more definite reference for weak and strong currency.
[font=Arial][color=#333333][color=#333333][font=Arial][size=3]I...
Ignored
Hi,

I'm sorry, but I'm not sure exactly what you're asking.

In any case, I would prefer not to add further complication to the indicator at this point. People are already commenting that it runs too slowly.

The indy can create an output file (see notes on OutputFile parameter in post #1). You can then use the data from this file for further analysis, or otherwise use it in any way that you wish (for more info, please see posts #305 and #368).

David
 
 
  • Post #372
  • Quote
  • Nov 8, 2011 1:02am Nov 8, 2011 1:02am
  •  pedma
  • Joined Jan 2010 | Status: Member | 363 Posts
Quoting hanover
Disliked
Pedma,

It is better to have your EA read the OutputFile that can be generated by the RS indy (see OutputFile parameter info in post #1), that to attempt to use iCustom().

You can use the attached code shell to have your EA read the file into more easily referenced arrays. More info here.

Most of the functions in the 'FUNCTIONS LIBRARY' section are not used. You can delete any functions that cause a warning error ("function xxx is not referenced...
Ignored
Hi David,

Thanks for the tips. I will see the link you gave. So far, this is what I did:
- put "recent strength indicator.ex4" to ..../experts/indicators
- put "Presets---Recent Strength.txt" file to .../experts/files
- put "test1.ex4" to ..../experts directory

Is that right ?

Thanks
-pedma-
Good friends are more valuable than gold ...
 
 
  • Post #373
  • Quote
  • Edited 3:07pm Nov 8, 2011 3:41am | Edited 3:07pm
  •  hanover
  • Joined Sep 2006 | Status: ... | 8,092 Posts
Quoting pedma
Disliked
Hi David,

Thanks for the tips. I will see the link you gave. So far, this is what I did:
- put "recent strength indicator.ex4" to ..../experts/indicators
- put "Presets---Recent Strength.txt" file to .../experts/files
- put "test1.ex4" to ..../experts directory

Is that right ?

Thanks
-pedma-
Ignored
Pedma,

Yes, those are the correct folders, but you need to use the code from test1.mq4 in your EA, if you want the EA to automatically load the RSvalue array from the file Output---Recent Strength.csv. Then you can use the RSvalue values directly in calculating your buy/sell/close etc signals.

OK, to summarize --- here is the process, step by step (see also the flow diagram attached below):

1. Download Build Strength Preset File.mq4 script from post #1 into your ..../experts/scripts folder. Then run it, which will create your parameter file Presets---Recent Strength.txt
Make sure you set its UseOutputFile parameter = TRUE.
If you make a mistake, you can always re-run it, as it will simply overwrite the file.
For more info, see the 'AUTOMATED PARAMETER FILE BUILD' section in post #1.


2. Download the Recent Strength indy from post #1 into your .../experts/indicators folder, and attach it to any MT4 chart.

NOTE: If, at any time, you want to change any of its parameters, don't use the MT4 dialog window. Instead, you must edit the settings in the parameter file Presets---Recent Strength.txt using an editor like Notepad. Then save the file, and refresh the Recent Strength indy in MT4 (to have it re-read the changed parameter settings). For more info, see the 'PARAMETERS' section in post #1.

Provided that you've done everything correctly so far, the Recent Strength indy will periodically output values to a file named Output---Recent Strength.csv in the ...../experts/files folder. Each time it does this, the whole file is rewritten. How often this happens depends on the RefreshEveryXMins parameter:
--- If you have the RefreshEveryXMins parameter set to 1, it will be rewritten every time a new M1 candle starts to form (on the chart to which the RS indy is attached)
--- If you have the RefreshEveryXMins parameter set to 5, it will be rewritten every time a new M5 candle starts to form......
--- and so on


3. Now you must write your EA. Use the code in test1.mq4 (download from here) as a starting point. Every time you call the LoadRSvalues() function, the EA will read the Output---Recent Strength.csv file, and update the values in the RSvalue array. Then you can reference this array directly in your EA code as explained in the link I provided earlier. In this way, the RS values can become part of the logic used in your EA's trading signals. More info here.


I hope that makes sense. It is quite complex, but I'm afraid that the RS system wasn't originally designed with all of this in mind. I'm assuming that you are a reasonably experienced MQL4 programmer.

David
Attached Image (click to enlarge)
Click to Enlarge

Name: RS indy flow diagram.JPG
Size: 73 KB
 
 
  • Post #374
  • Quote
  • Nov 8, 2011 9:14am Nov 8, 2011 9:14am
  •  pedma
  • Joined Jan 2010 | Status: Member | 363 Posts
Quoting hanover
Disliked
Pedma,

Yes, those are the correct folders, but you need to use the code from test1.mq4 in your EA, if you want the EA to automatically load the RSvalue array from the file Output---Recent Strength.csv. Then you can use the RSvalue values directly in calculating your buy/sell/close etc signals.

OK, to summarize --- here is the process, step by step:

1. Download Build Strength Preset File.mq4 script (from post #1, install it in your ..../experts/scripts folder). Then run it, which will create your parameter file...
Ignored
Hi David,

I'm not a good programmer, just still learning ...
*) After changing the UseOutputFile parameter = TRUE , I got the result under ...../experts/files/

*) I used your test1 ea, modified the code a little to make its function as indicator.

Quote
Disliked
double AUD_M1,AUD_M5,AUD_M15,AUD_M30,AUD_H1,AUD_H4,AUD_D1;
double USD_M1,USD_M5,USD_M15,USD_M30,USD_H1,USD_H4,USD_D1;
double EUR_M1,EUR_M5,EUR_M15,EUR_M30,EUR_H1,EUR_H4,EUR_D1;

string SAUD_M1,SAUD_M5,SAUD_M15,SAUD_M30,SAUD_H1,SAUD_H4,SAUD_D1;
string SUSD_M1,SUSD_M5,SUSD_M15,SUSD_M30,SUSD_H1,SUSD_H4,SUSD_D1;
string SEUR_M1,SEUR_M5,SEUR_M15,SEUR_M30,SEUR_H1,SEUR_H4,SEUR_D1;
Quote
Disliked
int start() {
AUD_M1 = RSvalue[_AUD][_M1][0];
AUD_M5 = RSvalue[_AUD][_M5][0];

SAUD_M1 = "AUD-M1 " + NumberToStr(AUD_M1, 2);
SAUD_M5 = "AUD-M5 " + NumberToStr(AUD_M5, 2);

objname = "AUD M1";
ObjectCreate(objname,OBJ_LABEL,0,0,0);
ObjectSet(objname,OBJPROP_XDISTANCE,1000);
ObjectSet(objname,OBJPROP_YDISTANCE,50);
FontColor = White;
ObjectSetText(objname,SAUD_M1,FontSize,FontName,FontColor);
etc ....

Later I will try to use "ArraySort" to get the value from small to big, put it in array.

Some questions :

a) The value of "Output---Recent Strength.csv" file is changed automatically or it's changed by your "Recent Strength" indicator ?
Or by the script, which is run once ?

b) After inserting mytesting indicator to chart, then I delete it (deleting via Indicator List). But the label & value is still there, until I delete the OBJECT list. Why it's not automatically removed ?

Thanks a lot David.
Best Regards,
-pedma-
Attached Image
Good friends are more valuable than gold ...
 
 
  • Post #375
  • Quote
  • Edited 2:07pm Nov 8, 2011 1:12pm | Edited 2:07pm
  •  hanover
  • Joined Sep 2006 | Status: ... | 8,092 Posts
Pedma,

From your screenshot, it looks like you are loading the arrays correctly, and are displaying good values.


Quoting pedma
Disliked
Some questions :

a) The value of "Output---Recent Strength.csv" file is changed automatically or it's changed by your "Recent Strength" indicator ?
Or by the script, which is run once ?

b) After inserting mytesting indicator to chart, then I delete it (deleting via Indicator List). But the label & value is still there, until I delete the OBJECT list. Why it's not automatically removed ?
Ignored
a) The values in the file Output---Recent Strength.csv are changed by the Recent Strength indy. The whole file is rewritten. How often this happens depends on the RefreshEveryXMins parameter:
--- If you have the RefreshEveryXMins parameter set to 1, it will be rewritten every time a new M1 candle starts to form (on the chart to which the RS indy is attached)
--- If you have the RefreshEveryXMins parameter set to 5, it will be rewritten every time a new M5 candle starts to form......
--- and so on

NOTE: Remember that to change the values of the RS indy parameters, you need to edit the settings in the parameter file Presets---Recent Strength.txt using an editor like Notepad. Then save the file, and refresh the Recent Strength indy in MT4 (to have it re-read the changed parameter settings).

b) Use MQL4's ObjectDelete() function to delete any unwanted objects. The usual way to do this is to call the function from within the deinit() procedure, which MT4 runs automatically when you remove an indy from a chart.


NOTE:
SAUD_M1 = "AUD-M1 " + NumberToStr(AUD_M1, 2);
SAUD_M5 = "AUD-M5 " + NumberToStr(AUD_M5, 2);

This should be:
SAUD_M1 = "AUD-M1 " + NumberToStr(AUD_M1, "2");
SAUD_M5 = "AUD-M5 " + NumberToStr(AUD_M5, "2");


David


[EDIT] NOTE: I have added a flow diagram to my previous post.
 
 
  • Post #376
  • Quote
  • Edited 12:49am Nov 9, 2011 12:09am | Edited 12:49am
  •  pedma
  • Joined Jan 2010 | Status: Member | 363 Posts
Quoting hanover
Disliked
Pedma,

From your screenshot, it looks like you are loading the arrays correctly, and are displaying good values.




a) The values in the file Output---Recent Strength.csv are changed by the Recent Strength indy. The whole file is rewritten. How often this happens depends on the RefreshEveryXMins parameter:
--- If you have the RefreshEveryXMins parameter set to 1, it will be rewritten every time a new M1 candle starts to form (on the chart to which the RS indy is attached)
--- If you have the...
Ignored
Hi David,

You're so great !! Thanks a lot. I will try again.

So, even I did not use the "RS indicator" (because it's too heavy at my slow computer), I must use it (load the indy to chart) every time, after I made changing in Presets---Recent Strength.txt file, and then remove the chart. If no changing made to Txt file, I don't need to load the "RS indy", is that right ?
Or may be I must get the part that handle the variable "RefreshEveryXMins" from "RS indy" then put it to my testing indicator, to refresh the result at file "Output---Recent Strength.csv " ... so I do not need to load the "RS indy" even after make any changes to TXT file. Any idea?

Thanks
-pedma-
Good friends are more valuable than gold ...
 
 
  • Post #377
  • Quote
  • Nov 9, 2011 1:32am Nov 9, 2011 1:32am
  •  hanover
  • Joined Sep 2006 | Status: ... | 8,092 Posts
Quoting pedma
Disliked
Hi David,

You're so great !! Thanks a lot. I will try again.

So, even I did not use the "RS indicator" (because it's too heavy at my slow computer), I must use it (load the indy to chart) every time, after I made changing in Presets---Recent Strength.txt file, and then remove the chart. If no changing made to Txt file, I don't need to load the "RS indy", is that right ?
Or may be I must get the part that handle the variable "RefreshEveryXMins" from "RS indy" then put it to my testing indicator, to refresh...
Ignored
Pedma,

As currency prices move, the strength values move accordingly. Hence you need to have the RS indy attached to your chart all the time, to continuously update the Output---Recent Strength.csv file, so that your EA always has access to the latest values.

If your computer can not run the RS indy, then I'm afraid that you're completely stuck. However, there are some hints in the 'COMPUTER PERFORMANCE' section of post #1 for making the RS indy run faster, which may help you. The last point about "trimming the list of constituent pairs" doesn't apply because this would have been already done by the Build Strength Preset File.mq4 script.

One final point: make sure that you're running MT4 build 409 (if your br0ker offers it). Build 406 somehow made many indicators and EAs run a lot more slowly. (To find your MT4 build, use menu option: Help.... About.....)

David
 
 
  • Post #378
  • Quote
  • Nov 9, 2011 2:02am Nov 9, 2011 2:02am
  •  pedma
  • Joined Jan 2010 | Status: Member | 363 Posts
Quoting hanover
Disliked
Pedma,

As currency prices move, the strength values move accordingly. Hence you need to have the RS indy attached to your chart all the time, to continuously update the Output---Recent Strength.csv file, so that your EA always has access to the latest values.

If your computer can not run the RS indy, then I'm afraid that you're completely stuck. However, there are some hints in the 'COMPUTER PERFORMANCE' section of post #1 for making the RS indy run faster, which may help you. The last point about "trimming the list of constituent pairs"...
Ignored
Hi David,

Thank you. My MT4 has version of 406. I will try to update it & try the "Computer Performance" solution. If the result is not good, I will try to modify your "Currency Strength - Giraia" indy.

Thanks again for all you have done, David.
-pedma-
Good friends are more valuable than gold ...
 
 
  • Post #379
  • Quote
  • Nov 10, 2011 1:36am Nov 10, 2011 1:36am
  •  pedma
  • Joined Jan 2010 | Status: Member | 363 Posts
Quoting pedma
Disliked
Hi David,

Thank you. My MT4 has version of 406. I will try to update it & try the "Computer Performance" solution. If the result is not good, I will try to modify your "Currency Strength - Giraia" indy.

Thanks again for all you have done, David.
-pedma-
Ignored
Hi David,

After trying the Recent Strength and the speed problem is still not solved, I decide to use "Currency Strength - Giraia" for my new indicator. I try to sort the value from Small to Big, example :

Currency Value
---------------
USD = 3.1
EUR = 7.3
GBP = 4.4
CHF = 3.1
CAD = 5.6
AUD = 2.7
JPY = 5.3
NZD = 4.4

After put all values to an Array, I can use "ArraySort" to sort the value from Small to Big :
2.7 , 3.1 , 3.1 , 4.4, 4.4, 5.3 , 5.6, 7.3
But I have problem to assign the Currency for each Value.

The problem :
a) If I use 2 dimension Arrays, the data type of Currency & Value are not the same (string & double)
b) If I just check on the Value (copy the value to another array before running the "ArraySort" to have the original one USD = 3.1, EUR = 7.3, etc ...), how to point it to the right currency after sorting ? (some Currency has same value).
May be I can give index to each Value, but don't know how to do it ....

Any Idea ?

Thanks
-pedma-
Good friends are more valuable than gold ...
 
 
  • Post #380
  • Quote
  • Nov 10, 2011 4:03pm Nov 10, 2011 4:03pm
  •  hanover
  • Joined Sep 2006 | Status: ... | 8,092 Posts
Quoting pedma
Disliked
Hi David,

After trying the Recent Strength and the speed problem is still not solved, I decide to use "Currency Strength - Giraia" for my new indicator. I try to sort the value from Small to Big, example :

Currency Value
---------------
USD = 3.1
EUR = 7.3
GBP = 4.4
CHF = 3.1
CAD = 5.6
AUD = 2.7
JPY = 5.3
NZD = 4.4

After put all values to an Array, I can use "ArraySort" to sort the value from Small to Big :
2.7 , 3.1...
Ignored
Pedma,

I have sorted the currencies from highest to lowest in the new version of the indy (attached). I have included comments in the code, so you can follow how I've done it.

The trick is as follows: you create a string array, where each element contains all of the items that you want sorted, in order of priority. Numeric values can be formatted using my NumberToStr() function. For example, the elements of the array might look like this:
Inserted Code
 3.1 USD
 7.3 EUR
 4.4 GBP
 3.1 CHF
 5.6 CAD
 2.7 AUD
 5.3 JPY
 4.4 NZD
The strength value is the first part of the string, because we want it to be the highest priority sort. Now I sort the string array in descending order (highest value first). I have used my ShellsortStringArray() function. This comes from the library of functions that I've created, to extend the MQL4 language. I have included it at the end of the code in the attached indy. More info here.

After the sort, we have an array with elements like this:
Inserted Code
 7.3 EUR
 5.6 CAD
 5.3 JPY
 4.4 GBP
 4.4 NZD
 3.1 CHF
 3.1 USD
 2.7 AUD
Then I simply use MQL's StringSubstr() function to extract the value, and the currency symbol, from each array element.

Hope this helps.

David
Attached File(s)
File Type: mq4 Currency Strength - Giraia.mq4   98 KB | 1,202 downloads
 
 
  • Platform Tech
  • /
  • Recent Strength indicator
  • Reply to Thread
    • 1 1718Page 192021 44
    • 1 18Page 1920 44
0 traders viewing now
  • More
Top of Page
  • Facebook
  • Twitter
About FF
  • Mission
  • Products
  • User Guide
  • Media Kit
  • Blog
  • Contact
FF Products
  • Forums
  • Trades
  • Calendar
  • News
  • Market
  • Brokers
  • Trade Explorer
FF Website
  • Homepage
  • Search
  • Members
  • Report a Bug
Follow FF
  • Facebook
  • Twitter

FF Sister Sites:

  • Metals Mine
  • Energy EXCH
  • Crypto Craft

Forex Factory® is a brand of Fair Economy, Inc.

Terms of Service / ©2023