[Archive!] Any rookie question, so as not to clutter up the forum. Professionals, don't pass it by. Couldn't go anywhere without you - 2. - page 33

 
volshebnik:
Do you want to show that testing happens ? If that's what you mean, at Period_MA=5 yes, it does. But at the other limits I described - no ....


Added a little history control

   n=1;

   while(true)                                                             // Цикл по перебору свечей вниз до изгиба МА Синей
    {
       if (n>=Bars) {
         Print("Не хватает истории");
         return(0);
      } 
Files:
transerk1c.mq4  19 kb
 
Jaguar1974:
What do you mean by "pending order", if the order has gone to the server, will it necessarily be displayed in the terminal?

The fact that the order has gone to the server does not mean that it will be executed by the server. If the order is executed, it will be displayed in the terminal. Otherwise you have to ask for the reason why the server rejected the order.
 
Vinin:


Added a little history control

Vinin , thank you very much for your time ! The matter has moved from the "dead point". I have determined the maximal MA period = 80, at which the history bars are enough (for a one-minute timeframe). I did not know there were such "pitfalls".
 
drknn:


Give me the ex4 file - I'll have a look. But if it has the author's credentials, I'll be forced to give you just the credentials. On the other hand, if the Expert Advisor is available in the public domain, why not take the source code from there? Where did you even get this Expert Advisor?

И... Delete a duplicate of your post - no point in typing it twice.


Hello again!

Is it possible to attach a MA from another Timeframe to a chart? If so, how? Thanks in advance!

P.S. What about the decompilation did it work?

 
100yan:

Can an MA from another Timeframe be attached to a chart? If so, how? Thanks in advance!

P.S. What about the decompilation did it work?

#MTF_MovingAverage.mq4
A set of indicators with higher TFs.


And forget the word decompilation on this forum, copyright infringement is frowned upon.

 
100yan:


Hello again!

Is it possible to attach a MA from another Timeframe to a chart? If so, how? Thanks in advance!

P.S. What about the decompilation ...did it work?


I was away - didn't download the file. I came back 10 hours later and it's gone. Send it to me by e-mail or in person.

Programmatically, you can create an indicator that will take price values from another timeframe and display them on any other one. Just don't need all that - just set the right averaging peroid.

 
granit77:
#MTF_MovingAverage.mq4
A set of indicators with higher TFs.


And forget the word decompilation on this forum, copyright infringement is frowned upon.


Thanks to DRKNN and granit77!

About the copyright - it's my file..., just killed a day on it... and there's a glitch. Decompiling is no longer relevant, but out of principle I'd like to learn.

"Just don't need it all - just set the right averaging peroid." - please look!!! how to average!!?

 
100yan:


Thanks to DRKNN and granit77!

About the copyright - it's my file..., just killed a day on it... and there's a glitch. Decompiling is no longer relevant, but out of principle I'd like to learn.

"Just don't need it all - just set the right averaging peroid." - please look!!! how to average!!?


Look, we open timeframe H1. Let's throw a moving average with a period = 24 on it. To understand what this moving average shows, we have to remember that it is an arithmetic mean. There are 24 hours in a day. On H1 timeframe this moving average will show the average direction of price trend for the last 24 hours. To be more precise, it will show the average direction of price movement within the last 24 hours. Now let's switch to the M30 timeframe. It is clear that there will be 2 times more candles in one day on this chart than on H1. So, to see the average daily price direction using the moving average, we should set the averaging period = 24*2 = 48. For M15 this would be period = 96.

I have repeatedly seen traders on M15 engage a moving average with period = 100. This value is chosen by gut feeling - it just doesn't show the average daily trend badly. But if you use your brain, it is clear that using 96-period moving average will give more accurate results.

It is up to you to further calculate whether or not you want to use a particular moving average period. All you need is to have a clear justification for why you're using this particular averaging. I have given the necessary logical basis.

 
drknn:


Look, we open the time frame H1. Let us draw a sliding indicator with period = 24. To understand what this moving average shows, we should remember that it is an arithmetic mean. There are 24 hours in a day. On H1 timeframe this moving average will show the average direction of price trend for the last 24 hours. To be more precise, it will show the average direction of price movement within the last 24 hours. Now let's switch to the M30 timeframe. It is clear that there will be 2 times more candles in one day on this chart than on H1. So, to see the average daily price direction using the moving average, we should set the averaging period = 24*2 = 48. For M15 this would be period = 96.

I have repeatedly seen traders on M15 using a moving average with period = 100. This value is chosen by gut feeling - it is just not a bad indicator of the average daily trend. But if you use your brain, it is clear that using 96-period moving average will give more accurate results.

It is up to you to further calculate whether or not you want to use a particular moving average period. All you need is to have a clear justification for why you're using this particular averaging. I have provided the necessary logical basis.

Thanks again drknn and granit77! !!!! #MTF_MovingAverage.mq4 - if this is an EA, it is not attached to the chart for some reason... :-(,

The question is exactly about the plotting...

I need to draw M5 (144) on M1 chart. i.e. it turns out I need M1 (144*5=720), right?

But what should I do if the following TFs do not coincide by their multiplicity? - I would like to automatically calculate the MA when changing TF. Is there such a function for determining the TF?

 
100yan:

Thanks again drknn and granit77! !!!! #MTF_MovingAverage.mq4 - if this is an EA, it is not put on the chart for some reason... :-(,

The question is exactly about the plotting...

I need to draw M5 (144) on M1 chart. i.e. it turns out I need M1 (144*5=720), right?

But what should I do if the following TFs do not coincide by their multiplicity? - I would like to automatically calculate the MA when changing TF. Is there such a function for determining the TF?


This can easily be done if necessary