As DrawArrow() is a custom function I/we don't know the code, and you don't check and print the error, this function call might cause... I can't tell you the reason.
Learn to use the debugger, it's made to find errors after the code compiles.
- www.metatrader5.com
As DrawArrow() is a custom function I/we don't know the code, and you don't check and print the error, this function call might cause... I can't tell you the reason.
Learn to use the debugger, it's made to find errors after the code compiles.
There are no errors while compiling
here is the code
void DrawArrow(string name, datetime time, double price, color arrowColor, int arrowCode) { if (ObjectFind(0, name) < 0) // If the object does not exist { ObjectCreate(0, name, OBJ_ARROW, 0, time, price); ObjectSetInteger(0, name, OBJPROP_COLOR, arrowColor); ObjectSetInteger(0, name, OBJPROP_ARROWCODE, arrowCode); ObjectSetInteger(0, name, OBJPROP_WIDTH, 2); // Set the arrow width } }
Still how is anyone supposed to help you?
You say they don't get drawn... but there is nothing in the code that you have presented that allows you to confirm if they should have been drawn.
Use some print statements to confirm when an arrow should be drawn, then see if they have or not, including checking the object list on the chart in case you have created them in a time/price not visible.
use ResetLastError and GetLastError() to understand if things are failing...
use the debugger to step through the code and check values are creating the right conditions etc..
if (open[0] > rsiLevel && close[0] < rsiLevel) // If candle opens above 50 and closes below 50
-
Use the debugger or print out your variables, including _LastError and prices and find out why. Do you really expect us to debug your code for you?
Code debugging - Developing programs - MetaEditor Help
Error Handling and Logging in MQL5 - MQL5 Articles (2015)
Tracing, Debugging and Structural Analysis of Source Code - MQL5 Articles (2011)
Introduction to MQL5: How to write simple Expert Advisor and Custom Indicator - MQL5 Articles (2010) - Open and close are prices (1.12345). They have nothing to do with RSI (50). You need to read and remember, the RSI at the start of the candle and after it closes.

- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
Below is aportion of my code that once the condition is met it has to draw an arrow above the next opening candle.
Teh arrows do not get drawn waht am i doing wrong