Here is the code of the indicator (tweaked and changed with VIN - thanks a lot). All good, seems to make sense....... Wanted to change it a bit. HOWEVER. The idea is MACD at the bottom begins to grow (ALL its values are less than the value N) here and set the arrow BAY, for SHEL vice versa. I tried to change trade conditions (changed values < to > did not work). If MACD starts to grow (it is negative), the moment of arrow's appearance coincides with a trading condition. Seems right...... BUT the arrows have appeared too much........... Please tell me!!!!!!!!!!!!!!
Please advise! All MACD values are contained in a one-dimensional array MACD[], I want to check them in batches (every 10 elements) for maxima and minima, and draw them in the indicator. Here is the code:
for(i=0; i<limit; i=i+10)
{
int k = i;
for(k=i; k<i+10; k++)
{
x10[k] = MACD[k];
}
int maxValueIdx=ArrayMaximum(x10);
int minValueIdx=ArrayMinimum(x10);
MAX[k] = maxValueIdx;
MIN[k] = minValueIdx;
}
Noterday писал(а)>> Please advise! All MACD values are contained in a one-dimensional array MACD[], I want to check them in batches (every 10 elements) for highs and lows, and draw them in the indicator. Here is the code: Why isn't it drawn?
What is the dimension of x10 array ?
10? Then you should rewrite it like this:
for(i=0; i<limit; i+=10)
{
int k;
for(k=0; k<10; k++)
{
x10[k] = MACD[i+k];
}
int maxValueIdx=ArrayMaximum(x10);
int minValueIdx=ArrayMinimum(x10);
MAX[i] = maxValueIdx;
MIN[i] = minValueIdx;
}
and it is not clear what exactly you want in the MAX and MIN arrays
The situation is as follows, I open an order with orderSend, 1 lot, I close it with orderClose, 0.5 lot.... How do I get a new order with another ticker to pick up the newly opened order?
Xors писал(а)>> The situation is as follows, I open an order with orderSend, 1 lot, I close it with orderClose, 0.5 lot.... it closes half of it and opens a new order with another ticket, how do I quickly pick up the ticket of the newly opened order?
no way. The only way is to brute-force among open and pending orders.
Noterday писал(а)>> Please advise! All MACD values are contained in a one-dimensional array MACD[], I want to check them in batches (every 10 elements) for highs and lows, and draw them in the indicator. Here is the code: Why isn't it drawn?
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.
Here is the code of the indicator (tweaked and changed with VIN - thanks a lot).
All good, seems to make sense....... Wanted to change it a bit. HOWEVER. The idea is MACD at the bottom begins to grow (ALL its values are less than the value N) here and set the arrow BAY,
for SHEL vice versa. I tried to change trade conditions (changed values < to > did not work). If MACD starts to grow (it is negative), the moment of arrow's appearance coincides with a trading condition. Seems right...... BUT the arrows have appeared too much...........
Please tell me!!!!!!!!!!!!!!
Есть МАКД с параметрами 9 и 12.
Верно ли, что он показывает разницу между МА с периодами 9 и 12? А то у меня какой-то разбег в цифрах.
Check compliance of ma_method, applied_price in MA and MAKD.
All MACD values are contained in a one-dimensional array MACD[], I want to check them in batches (every 10 elements) for maxima and minima, and draw them in the indicator.
Here is the code:
Why isn't it drawn?
Please advise!
All MACD values are contained in a one-dimensional array MACD[], I want to check them in batches (every 10 elements) for highs and lows, and draw them in the indicator.
Here is the code:
Why isn't it drawn?
and it is not clear what exactly you want in the MAX and MIN arraysWhat is the dimension of x10 array ?
10?
Then you should rewrite it like this:
The situation is as follows, I open an order with orderSend, 1 lot, I close it with orderClose, 0.5 lot.... it closes half of it and opens a new order with another ticket, how do I quickly pick up the ticket of the newly opened order?
no way.
The only way is to brute-force among open and pending orders.
lots=UseLots();
if (lots==0) return(0);
i=OrderSend(Symbol(),OP_BUY,UseLots(),NormalizeDouble(Ask, Digits),slippage,Ask-StopLoss*Point,Ask+TakeProfit*Point,EA,magic,0,Blue);
lots=UseLots();
if (lots==0) return(0);
i=OrderSend(Symbol(),OP_SELL,UseLots(),NormalizeDouble(Bid, Digits),slippage,Bid+StopLoss*Point,Bid-TakeProfit*Point,EA,magic,0,Red);
Error 4107 on 1 of 10 orders or on 3 of 25 differently in the tester
And what is the slippage value reported and what is the quote 5 or 4 decimal places.Проверьте соответствие ma_method, applied_price в МА и МАКД.
Already. It was 120 instead of 12 for MA. I was amazed! :)
Please advise!
All MACD values are contained in a one-dimensional array MACD[], I want to check them in batches (every 10 elements) for highs and lows, and draw them in the indicator.
Here is the code:
Why isn't it drawn?