Any questions from newcomers on MQL4 and MQL5, help and discussion on algorithms and codes - page 346

 
Сергей:

I understand that for multicurrency the variant proposed by@Nauris Zukas will work, at least for me.

And your variant is better for single-currency, because it takes data from the chart to which it is attached.

In general, you do not understand it at all. You can put the cursor on the function name and press F1 - you get full help for it.

Vitaliy offered the function that equally works on MT4 and MT5 - therefore, he wrote that it is better to use it, all other things being equal.

You chose the one that only works on MT4.

 
Artyom Trishkin:

You've got it all wrong. You can put the cursor on the function name and press F1 - you will get full help on it.

Vitaliy offered you a function that works equally on MT4 and MT5 - that is why he wrote that it is better to use it, all other things being equal.

You chose the one that only works on MT4.

I see, thank you.
 
Сергей:

I understand that for multicurrency the variant proposed by@Nauris Zukas will work, at least for me.

Your version is better for single currency because it takes data from chart attached to it.

You can use Vitaly Muzichenko's variant, but don't forget to change Symbol(). Symbol() is always taken from the chart where it is attached. If you want to use another pair, just specify which currency pair is needed. For example like this:

 double EUR_point=SymbolInfoDouble("EURUSD",SYMBOL_POINT);

Good luck! :)

 
Vitaly Muzichenko:

And further on in the subject. Take the string parameter in quotes

These are his variable names.

 

Question:


There is an indicator1 which draws a line based on the maximum and blue of the last 20 values. On a candlestick chart it looks like a price channel.

There is another self-written indicator2 thatdraws a line like RSI in a separate window under the price chart.


How to make an indicator1 builds on data from indicator2.

 
Sergey Likho:

Question:


There is an indicator1 which draws a line based on the maximum and blue of the last 20 values. On a candlestick chart it looks like a price channel.

There is another self-written indicator2 thatdraws a line like RSI in a separate window under the price chart.


How to make an indicator1 builds on data from indicator2.

If you want that indicator2 is not drawn in a separate window, try to find #property indicator_separate_window and replace it with #property indicator_chart_window. Maybe it will help.
 
Nauris Zukas:
If you want to have indicator2 drawn not in a separate window, try to find #property indicator_separate_window and replace it with #property indicator_chart_window. Maybe it will help.

No, I want indicator1 to take an array of values from indicator2 instead of candlestick data (e.g. array Close[]).

 
Sergey Likho:

Question:


There is an indicator1 which draws a line based on the maximum and blue of the last 20 values. On a candlestick chart it looks like a price channel.

There is another self-written indicator2 thatdraws a line like RSI in a separate window under the price chart.


How to make indicator 1 draw a line like RSI?

Start reading from here

Forum for trading, automated trading systems & strategy testing

Any questions from newbies on MQL4, help and discussion on algorithms and codes

potom, 2017.10.15 16:07

How to add First/Previous function to an already prepared indicator. That is to edit it.

Everyone says this.

int OnCalculate (const int rates_total,
const int prev_calculated,
const datetime& time[],
const double& open[],
const double& high[],
const double& low[],
const double& close[],
const long& tick_volume[],
const long& volume[],
const int& spread[])
{

Should be replaced with this.

int OnCalculate (const int rates_total,
const int prev_calculated,
const int begin,
const double &price[])
{

But all this does not give any result. It may help to write it and not to edit it.

Can you tell me how to implement this function in detail?

 
Is there any chance that the program from chart A, on the last tick before the bar closes, will find a bar that has already appeared on chart B ? (The A and B charts represent different instruments)
That is, from the time a tick is received on chart A until a query about the number of bars on chart B is received, a new bar will appear on chart B.
 
Good afternoon, can you tell me what the order has from placement to history, id. all the time?
Reason: