Problems after data import for indicators
Forums › ProRealTime English forum › ProBuilder support › Problems after data import for indicators
- This topic has 5 replies, 3 voices, and was last updated 7 years ago by Derek.
-
-
02/23/2017 at 2:44 PM #26143
Hello!
When building simple indicators from data that is not available in PRT I usually follow this procedure:
12345678910if date= 20161028 THENvolch= -754940902elsif date= 20161031 THENvolch= -356964619elsif date= 20161101 THENvolch= 20145996elsif date= 20161102 THENvolch= -793765967return volchThe market timeframe is set to standard with sundays showing.
Doing this I made the following observations and the question is: Is this a bug or something wrong with the code?
- All dates in the indicator are one day in the future, because PRT seems to move them one day back. You can see this in the file “Date_Bias.jpg” attached to this post. The value for the 28th October 2016 is displayed on the 27th October. As a consequence I moved all the dates in the indicator code by one day.
- Sometimes the indicator values are not displayed. In the attached screenshot the value for the 31st october (-356.964.619) is not displayed at all. It should appear on the 28th October.
- It is not possible to add standard indicators to the imported data with the sample code above. After changing the format like below at least simple moving averages can be applied but nothing more complicated. I do prefer the above version since it is saving code lines for import that are limited to 10.000. Is it possible to change this?
123456789if date= 20050715 THENvolch= 543194284endifif date= 20050718 THENvolch= 170619781endifif date= 20050719 THENvolch= -395613980endifThe indicator is attached for testing purposes. Please be aware that this thing takes some time to load.
02/23/2017 at 4:34 PM #26172- You are right, the date displayed is 1 day before what the “date” instruction is returning (attached screenshot example). I think it’s because “time” is returning 0 which is the first hour of the next day, keep in mind that all test made in data history is made only one time at Close of the candle, it may explain this difference.
- There is no 20161031 date returned by the “date” instruction, same situation as above.
- It could be possible to calculate moving average over past ‘volch’ data of course, just add these lines at the end of your code:
123ma = average[20](volch)return volch, ma1 user thanked author for this post.
02/23/2017 at 9:59 PM #2623502/24/2017 at 2:49 PM #26283If “date” is the day at the close of a 24h cfd candle and the cfd data flow pushes it overnight to next day (rather than remaining in the day during which “most of the candle” happens) and so always gives one extra day too much, then : replacing “date” with the instruction “opendate” in your importing procedure is likely to assign your imported data on the day you want, because it would be the correct day at the open of your daily candle (that’s a trick I often use in lower timeframes when I want to be sure my time data matches the candle I am considering, with openhour rather than hour, opentime rather than time, etc…). I hope it works for your 1)
02/25/2017 at 2:38 PM #2634302/26/2017 at 10:07 PM #26461 -
AuthorPosts
Find exclusive trading pro-tools on