Forum on trading, automated trading systems and testing trading strategies
Symbol Select -> SymbolGetDouble
whroeder1, 2018.01.19 15:08
On MT5: Unless the chart is that specific pair/TF, you must Synchronize the terminal Data from the Server.Timeseries and Indicators Access / Data Access - Reference on algorithmic/automated trading language for MetaTrader 5
Yes, I have seen that post. I modeled my own code after it. Of course, I took the Sleep()'s out.
Is it your intention to use the High of the current week or the prior week?
Your code is currently looking at the current week so it is "repainting" of sorts as the current weekly high can change as the days go by!
EDIT: If you really intend to use the current week, then you would have to recalculate the few previous bars so as to "repaint" the correct updated high for those previous days of the current week.
Is it your intention to use the High of the current week or the prior week?
Your code is currently looking at the current week so it is "repainting" of sorts!
Ah! Interesting. I think you are on to something . . . .
I edited my post, so read it again please!
I only want to calculate when I have a full week. Yup, I think I am repainting, which looks fine on the chart, but the Tester chokes on it.
I'll chase this down, but I am pretty sure you nailed it.
Thanks man!
I only want to calculate when I have a full week. Yup, I think I am repainting, which looks fine on the chart, but the Tester chokes on it.
I'll chase this down, but I am pretty sure you nailed it.
Thanks man!
Here is my modified test script that shows the W1 high on D1 bars. It may be useful to someone else who is trying to write a multi-timeframe indicator.
This test indicator:
1. Pulls W1 data when needed.
2. Works in the Tester. That is, it doesn't repaint because it uses a lookback when a new week is formed.
Thanks again to @Fernando Carreiro who pointed me in the right direction.
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
Below is a simple test script. It uses CopyHigh() to grab the high of the week so that I can create an envelope around the daily highs.
Thus, it runs on PERIOD_D1 chart and pulls PERIOD_W1 values.
It works as I would expect on the chart (picture 1).
But in the Visualization window of the Tester, I get all sorts of strange values (picture 2).
Here are the settings I used:
So here's an interesting tidbit: it only gives the strange values within the specified Custom period of the Tester, year 2017. The preceding data appears as I would expect. That is, all data from:
2018.09.17 15:03:57.237 USDCAD,Weekly: history begins from 2014.12.28 00:00
to the start of the Custom period.
Any thoughts?