When you post code please use the CODE button (Alt-S) !
Use the debugger to check the variable and the conditions: https://www.metatrader5.com/en/metaeditor/help/development/debug
Code-Debugging - Programme entwickeln - MetaEditor Hilfe
- www.metatrader5.com
MetaEditor hat einen eingebauten Debugger, mit dem Sie die Programmausführung Schritt für Schritt (durch einzelne Funktionen) ü...
You don't need a loop to achieve that.
bool buy_entry = Rsi_3 && Ask > MA_5;
Taking your code at face value, you have likely created an endless loop, which is why the chart freezes. You should spend as little time in OnTick() as possible. Fabio's above answer is correct and would fix the freeze problem.
Your topic has been moved to the section: Expert Advisors and Automated Trading
Please consider which section is most appropriate — https://www.mql5.com/en/forum/172166/page6#comment_49114893
Please consider which section is most appropriate — https://www.mql5.com/en/forum/172166/page6#comment_49114893
Your code is incomplete... How do you assign the RSI bool value?
void RSI_Signal()
{
RSI= false;
CopyBuffer(RSI_handle,0,0,2,RSI);
if (RSI[1] >= 70 || RSI[1] <= 30 )
{
RSI = true;
}
}
.
.
.
..............
if (RSI == true)
{
After a few candle or waiting to
{
if (Ask > MA_5)
{
Entry a Buy Order;
}
}
}I am confused about whether to use do while or while to create a loop, which will wait for the Ask value > MA_5, then exit loop to entry an order. Please help me
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
...
...