-
Post in the correct section: MQL4 section, (bottom of the Root page)?
General rules and best pratices of the Forum. - General - MQL5 programming forum?
Next time post in the correct place. -
Please edit your (original) post and use the CODE button (Alt-S)! (For large amounts of code, attach it.)
General rules and best pratices of the Forum. - General - MQL5 programming forum 2019.05.06
Messages Editor - FAHA313: 1-to add an input so that I change the number of bars to any number x, not to be redistricted to only 50 bars
Perhaps you should read the manual. MQL4 Reference → Language Basics → Variables → Input Variables
How To Ask Questions The Smart Way. 2004
How To Interpret Answers.
RTFM and STFW: How To Tell You've Seriously Screwed Up. - FAHA313: 2- a way to put two or more of this indicator on the chart side by side if I change x, ex: 50 bars and 20 bars each has won counts showing separately on the same chart
Either one indicator with multiple inputs and a combined output, or stop using Comment, create a label object with a Y offset input (so labels don't overlap).
- FAHA313: I couldn't as I don't know programing
any help would be appreciated
MT4: Learn to code it.
MT5: Begin learning to code it.If you don't learn MQL4/5, there is no common language for us to communicate. If we tell you what you need, you can't code it. If we give you the code, you don't know how to integrate it into your code.
or pay (Freelance) someone to code it. Top of every page is the link Code Base.
Hiring to write script - General - MQL5 programming forum 2019.08.21We're not going to code it for you (although it could happen if you are lucky or the problem is interesting.) We are willing to help you when you post your attempt (using CODE button) and state the nature of your problem.
No free help 2017.04.21
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
Hello;
I have a code to count number Bars up ( down ) in 50 (number) bars;
I just need help to modify this by
1-to add an input so that I change the number of bars to any number x, not to be redistricted to only 50 bars
2- a way to put two or more of this indicator on the chart side by side if I change x, ex: 50 bars and 20 bars each has won counts showing separately on the same chartI tried to do that but I couldn't as I don't know programing
any help would be appreciated
thanks
and here is the code I have:
//+------------------------------------------------------------------+
//| script program start function |
//+------------------------------------------------------------------+
int start()
{
//----
int n, upbar, downbar;
double candleclose, candleopen, isitupordown;
for(n=50; n!=0; n--)
{
candleclose = iClose(Symbol(), 0, n);
candleopen = iOpen(Symbol(), 0, n);
isitupordown = candleclose - candleopen;
if(isitupordown>0) upbar= upbar+1;
if(isitupordown<0) downbar= downbar+1;
}
Comment(upbar," Bars UP","\n", downbar," Bars DOWN");
//----
return(0);
}
//+------------------------------------------------------------------+