Re: Coding Help

1421
andrei-1 wrote: Sun Mar 19, 2023 7:30 pm One of them is ordinary. The second one is yours.

ATR_lim how many bars to take for averaging.

It may show a strange picture. Don't be surprised, it's MTF. You need to download the history of the desired timeframe.
Holy heavens! Thank you very much sir! You really thought about this indicator, it does all I need to do!!!

Thank God there is someone like you!!!!


Re: Coding Help

1422
andrei-1 wrote: Sun Mar 19, 2023 7:30 pm One of them is ordinary. The second one is yours.

ATR_lim how many bars to take for averaging.

It may show a strange picture. Don't be surprised, it's MTF. You need to download the history of the desired timeframe.
Sir if I may ask, does this indicator averages the previous candles (depending on input) then plots the average high and low on the chart?

I tried it on the daily to compare its calculations to other ADR.

My reason is, if it is the same as other ADR, then I can go to lower TF and get the same result.

So if I used the indi with H4 settings, I get the average of, lets say, 20 previous H4 candles then it plots the high and low?

Re: Coding Help

1423
andrei-1 wrote: Sun Mar 19, 2023 7:30 pm One of them is ordinary. The second one is yours.

ATR_lim how many bars to take for averaging.

It may show a strange picture. Don't be surprised, it's MTF. You need to download the history of the desired timeframe.
I calibrated your excellent indi sir and tried comparing the values to other ADR. I used the daily average because I have no way to calibrate it on lower timeframes.

Other indi = 20 period
ADR(average ADX) = 20 ATR, 20 period

This was the result. There are some discrepancy on past ADRs but the first ADR comparison is correct. Is this normal or my comparison is incorrect?

Please enlighten my ignorance.
Attachments

Re: Coding Help

1424
FoxFoxicle wrote: Sun Mar 19, 2023 8:56 pm
1. We will find out which day * is today and which is yesterday.
2. We will find out the price of yesterday's closing.
3. We calculate the average ATR for 5 (ATR_lim) days*.
4. Add and subtract from yesterday's* close.

These levels are stable all day*. I put asterisks because we can choose a different period.

I hope I understood you correctly.
Attachments
These users thanked the author andrei-1 for the post:
FoxFoxicle

Re: Coding Help

1425
andrei-1 wrote: Mon Mar 20, 2023 12:00 am 1. We will find out which day * is today and which is yesterday.
2. We will find out the price of yesterday's closing.
3. We calculate the average ATR for 5 (ATR_lim) days*.
4. Add and subtract from yesterday's* close.

These levels are stable all day*. I put asterisks because we can choose a different period.

I hope I understood you correctly.
Thanks for your input, even though I am not a coder, I will try to understand what you are telling.

But basically, I just want the way like ADR is calculated.

If ADR (20 period) calculates the average range of twenty previous daily candles, then plots the high/low of that average

what I need is the average (example: 20 period) of twenty previous four-hour candles (this is the same logic to h1 and below time frames) and plot the high/low of that average.

I am just curious if the calculation is accurate but the way it is plotted is exactly what I am looking for.

That's why I tried to use the daily settings if it will be the same as other ADR indicators because I will apply it to H4.

The rest of the features is superb and what I am looking for. Thank you very much!


Re: Coding Help

1426
andrei-1 wrote: Mon Mar 20, 2023 12:00 am 1. We will find out which day * is today and which is yesterday.
2. We will find out the price of yesterday's closing.
3. We calculate the average ATR for 5 (ATR_lim) days*.
4. Add and subtract from yesterday's* close.

These levels are stable all day*. I put asterisks because we can choose a different period.

I hope I understood you correctly.
I just searched the internet and I think this is how the ADR or the Average Daily Range is calculated. Is this correct sir?
Attachments

Re: Coding Help

1428
andrei-1 wrote: Mon Mar 20, 2023 1:35 am I'm afraid I don't understand you. Perhaps the usual MTF version will suit you. I can't help you find her right now.
Example. EURUSD

Day 1 high = 1.100
Day 1 low = 1.000
.....high(1.100) - low(1.000) = average range(0.1)

Day 2 high = 1.200
Day 2 low = 1.400
.....high(1.200) - low(1.400) = average range (0.2)

Day 3 high = 1.300
Day 3 low = 1.500
.....high(1.300) - low(1.500) = average range (0.2)

Sum all average ranges:
0.1 + 0.2 + 0.2 = 0.5

Divide average ranges by the number of days (period), here we have 3 days:
0.5/3 = 0.16

So the average daily range of EURUSD is 0.16 for 3 daily candles.

I hope we can apply this to H4, H1, and etc.


Who is online

Users browsing this forum: No registered users and 21 guests