[ARCHIVE]Any rookie question, so as not to clutter up the forum. Professionals, don't pass it by. Can't go anywhere without you - 5. - page 326

You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register
I'm not a fan of indicators, but I decided to check one thing. The Expert Advisor should buy at the price of the upper RSI indicator and sell at the price of the lower one, respectively. Only if the price is already above the upper boundary of the RSI indicator, then buy should be above this boundary and below the value of this boundary + some value of indent from the boundary upwards (in the code I specified just a number 0.1), for sales, on the contrary.
I did it like this:
External parameters:
Code of the function receiving the signal and the RSI value itself:(0.1 here is the margin tolerance for the range of buying or selling)
Sometimes the EA opens orders from the very level, sometimes much higher (for buying) and sometimes much lower (for selling). Why? The algorithm is elementary.
I am trying to write a simple indicator based on RSI (the analogue is RandomIndicatorSignals mq4).
I am trying to write a simple indicator based on RSI (for the analogue of this indicator RandomIndicatorSignals.mq4 from the article MQL4 Language for Dummies. Custom Indicators (Part 1)(https://www.mql5.com/ru/articles/1500).
The idea is simple, if RSI draws a top or a trough, it draws an arrow on the chart.
It seems to be ok, but in my opinion RSI value buffer for each candle is not filled, because of this it doesn't work. Here is the code.
I am trying to write a simple indicator based on RSI (the analogue is RandomIndicatorSignals mq4).
I am trying to write a simple indicator based on RSI (for the analogue of this indicator RandomIndicatorSignals.mq4 from the article MQL4 Language for Dummies. Custom Indicators (Part 1)(https://www.mql5.com/ru/articles/1500).
The idea is simple, if RSI draws a top or a trough, it draws an arrow on the chart.
It seems to be ok, but in my opinion RSI value buffer for each candle is not filled, because of this it doesn't work. Here is the code.
You are accessing uncalculated indicator values in loop.
Change
to
You are cycling back to the uncalculated indicator values.
Change
to
Thank you, it gave me an idea! However, I would like to understand the "physical meaning":) as our physicist used to say
I have a problem myself: 2 "slightly" different, but essentially the same action codes: Delete ALL pending orders
1) Does not work properly - only one order is deleted
2) It works fine - deletes all of them
Please explain: the meaning of "in this loop, you access the uncalculated values of the indicator".
You are cycling back to the uncalculated indicator values.
Change
to
Can you spell it out? Why is that? So I don't make any more mistakes in the future.
You are cycling back to the uncalculated indicator values.
Change
to
still not working, RSIBuffer3 only shows the RSI value on the last bar when hovering over a bar
And it still doesn't work, RSIBuffer3 only shows the RSI value on the last bar when hovering over the bar
Your 5th parameter is 0 - i.e. the last bar!
make it like this:
Excerpt from doc:
You are cycling back to the uncalculated indicator values.
Change
to
And what I also thought, according to your logic the tool should calculate RSI from limit and to 0 bar, but does it make a difference which side should calculate RSI from the end or from the beginning? It should calculate RSI for each bar in a given range and put the value into a buffer (I mean in an array), and then just compare three consecutive values in an array with each other. Or is it not?
Your 5th parameter is 0 - i.e. the last bar!
make it like this:
Excerpt from doc:
I'll give it a try, thanks