Hi guys. newbie here ..I need some help.
I would like to use rsi value of 5th candle as part of my entry so I need to keep checking for it's value . I compiled my code and have no errors or warnings. However when using strategy tester, I keep getting array out of range (89,38) . How can I fix this and make the code work as intended .
Please give advice if I have done it wrong. Here's the code below
Additionally, I have used rsi value in this code below below
If this is the source of the problem or my if statement is wrong please advise also . (I have a feeling it's wrong lol)
Thanks .
The checks a trading robot must pass before publication in the Market
- www.mql5.com
Before any product is published in the Market, it must undergo compulsory preliminary checks in order to ensure a uniform quality standard. This article considers the most frequent errors made by developers in their technical indicators and trading robots. An also shows how to self-test a product before sending it to the Market.
- Coding help
- How to set variables by currency symbol value - what's wrong with this code?
- Array out of range when running indicator
Seleucus:
Hi guys. newbie here ..I need some help.
Hi guys. newbie here ..I need some help.
I would like to use rsi value of 5th candle as part of my entry so I need to keep checking for it's value . I compiled my code and have no errors or warnings. However when using strategy tester, I keep getting array out of range (89,38) . How can I fix this and make the code work as intended .
Please give advice if I have done it wrong. Here's the code below
Additionally, I have used rsi value in this code below below
If this is the source of the problem or my if statement is wrong please advise also . (I have a feeling it's wrong lol)
Thanks .
1. Please paste your code correctly: click the button, then paste your code into the popup window. I have edited your message.
2. You have a gross mistake: you create an indicator handle on each tick. According to the MQL5 style, the indicator handle should be created ONLY ONCE and should be done in OnInit.
See an example of creating a simple Expert Advisor: Very Simple Intersection iMA Open Position
How to start with MQL5
- 2022.04.07
- www.mql5.com
This thread discusses MQL5 code examples. There will be examples of how to get data from indicators, how to program advisors...
I corrected my problem. I created the handle in the oninit function.
I had gotten bad examples from some YouTube videos where the handle is created in ontick function.
Thanks again for your examples.
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