SanAlex thanks for your help. I'm a little confused. Not the buffer number, but the colour index?
In Indicator.
In the Expert Advisor. 3 -colours. 3 situations.
I don't know very well - but it seems to me you need to add or change 0-1-2
//+------------------------------------------------------------------+//| main function returns true if any position processed |//+------------------------------------------------------------------+bool CSampleExpert::Processing(void)
{
//--- refresh ratesif(!m_symbol.RefreshRates())
return(false);
//--- refresh indicatorsif(BarsCalculated(m_handle_macd)<2)
return(false);
if(CopyBuffer(m_handle_macd,1,0,2,m_buff_MACD_main) !=2)
return(false);
// m_indicators.Refresh();//--- to simplify the coding and speed up access//--- data are put into internal variables
m_macd_current =m_buff_MACD_main[0];
m_macd_previous =m_buff_MACD_main[1];
m_macd_previous_2 =m_buff_MACD_main[2];
And here, you need to pick it up if you use three colours.
//+------------------------------------------------------------------+//| Check for short position opening |//+------------------------------------------------------------------+bool CSampleExpert::ShortOpened(void)
{
bool res=false;
//--- check for short position (SELL) possibilityif(m_macd_current>m_macd_previous) ---- тут m_macd_previous_2 > <
{
Вещественные типы (double, float) - Типы данных - Основы языка - Справочник MQL5 - Справочник по языку алгоритмического/автоматического трейдинга для MetaTrader 5
Allow the use of cookies to log in to the MQL5.com website.
Please enable the necessary setting in your browser, otherwise you will not be able to log in.
You are signed in. Two-factor authentication has been disabled. Set it up again and scan a new QR code, or continue with two-factor authentication disabled.
SanAlex thanks for your help. I'm a little confused. Not the buffer number, but the colour index?
In Indicator.
In the Expert Advisor. 3 -colours. 3 situations.
I don't know very well - but it seems to me you need to add or change 0-1-2
And here, you need to pick it up if you use three colours.
So as not to reinvent the wheel, give me a solution.
There is a csv file with the following contents:
1,2,3
4,5,6
7,8,9
I need to get an array:
[
[1 2 3]
[4 5 6]
[7 8 9]
]
Hello. Gentlemen experienced programmers, please advise. How do I colour a line? The condition while >= blue, while <= red.
Hello. Gentlemen experienced programmers, please advise. How do I colour a line? The condition while >= blue, while <= red.
UseDRAW_COLOR_LINE drawing style
ArrayBsearch? ArraySort?
Vladimir I am usingDRAW_COLOR_LINE drawing style. What to do with conditions while >= blue, while <= red. A loop in a loop?
ArrayBsearch? ArraySort?
Place a condition on line 130.
Cleaned it up a bit:
The code works, it changes colour.
I've been puzzled for three days. Is the flat left DimGray? Need if up or equal blue. If down or equal red.
I've been puzzled for three days. Is the flat left DimGray? Need if up or equal blue. If down or equal to red.
You cannot compare double numbers via '=='(see reference).
It should be compared like this:
This is how it is in the indicator:
Result: