Hello, I have been learning to code mql4 to start building my own expert advisors and I made this relative strength indicator for a friend.
You need to specify the window you will put it in, the main chart window is 0 so the first extra window is 1, etc. I should be able to work out how to put it in the right window anyway but it's early days yet and I have a lot to learn. You can alter the ma used to calculate the relative strength on the 1 min chart. You can also alter the font size and gap between lines so you can make it bigger or smaller.
Any coder who looks at the code will probably fall off their chair laughing as I have obviously not got the hang of using arrays and loops yet so it's all longhand. Copy and paste helped a lot. Eurchf is calculated manually because VantageFX who are my broker no longer offer this pair. There is SOME nifty coding in there.
The strengths are worked out by looking at each pair and finding whether the price is above or below the 200 sma. The currency that is "winning", ie stronger, gets a point. Each pair is scored between 0 and 7 with 0 being weak and 7 being strong. This is done for 4 different timeframes. Obviously the 1 min changes fairly frequently.
As far as I can tell the code is robust despite being longer than strictly necessary. I'm happy to share this for free as someone might find it useful. Seeing the relative strengths of the 4 different timeframes on the same indicator could be useful to find the best pair to trade if you're into trading lower timeframes.
I am in the process of building expert advisors to run my mechanical end of day systems. I have one up and running now with a trade explorer but there have been no trades as yet. I have two other systems coming online shortly. If you would like to know more as well as keep up to date day to day with my free systems just go to www.hughbrissforex.com and register for free.
By the way, if you are good at coding and would like to let me know how I could have done this with less code (I know it's arrays and loops but how exactly?) then feel free. Thanks.
Edward/Hugh Briss
You need to specify the window you will put it in, the main chart window is 0 so the first extra window is 1, etc. I should be able to work out how to put it in the right window anyway but it's early days yet and I have a lot to learn. You can alter the ma used to calculate the relative strength on the 1 min chart. You can also alter the font size and gap between lines so you can make it bigger or smaller.
Any coder who looks at the code will probably fall off their chair laughing as I have obviously not got the hang of using arrays and loops yet so it's all longhand. Copy and paste helped a lot. Eurchf is calculated manually because VantageFX who are my broker no longer offer this pair. There is SOME nifty coding in there.
The strengths are worked out by looking at each pair and finding whether the price is above or below the 200 sma. The currency that is "winning", ie stronger, gets a point. Each pair is scored between 0 and 7 with 0 being weak and 7 being strong. This is done for 4 different timeframes. Obviously the 1 min changes fairly frequently.
As far as I can tell the code is robust despite being longer than strictly necessary. I'm happy to share this for free as someone might find it useful. Seeing the relative strengths of the 4 different timeframes on the same indicator could be useful to find the best pair to trade if you're into trading lower timeframes.
I am in the process of building expert advisors to run my mechanical end of day systems. I have one up and running now with a trade explorer but there have been no trades as yet. I have two other systems coming online shortly. If you would like to know more as well as keep up to date day to day with my free systems just go to www.hughbrissforex.com and register for free.
By the way, if you are good at coding and would like to let me know how I could have done this with less code (I know it's arrays and loops but how exactly?) then feel free. Thanks.
Edward/Hugh Briss
Attached File(s)
Clives Strongest Weakest v5B.mq4
26 KB
|
479 downloads