1. Can someone suggest how I can input these dates/colors into an array? I'm not overly familiar with how arrays work in MQL4
2. Can someone show me how to create a condition that will find out if the current date (within the backtest) is within a GREEN signal?- Read about arrays! Here and in the reference of the editor and google yourself. An array can be of any type even color or datetime.
color c1, c2; ... c1 = clrRed; c2 = clrGreen; ... if (c2 == clrGreen) { ... }
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've created an EA that works very well in backtesting. However, I have a different program that I use altogether which I use to signal GREEN/RED. Green is when I consider the market conditions favourable to go long stocks. Red is when I go to cash.
I would like to incorporate the two systems while running a backtest. Basically what I want to do is create dates. For example:
01/30/2015 Green
06/17/2015 Red
09/02/2015 Green
03/01/2016 Red
These dates are just an example, but I would like to take the dates/signals and put them into some kind of an array. I then what to add a condition to my existing EA that ONLY buys long when GREEN and doesn't do anything when RED.
So, my questions:
1. Can someone suggest how I can input these dates/colors into an array? I'm not overly familiar with how arrays work in MQL4
2. Can someone show me how to create a condition that will find out if the current date (within the backtest) is within a GREEN signal?