Paul, Thanks for the additional ideas. I have given this a little thought. I don't think it would work as part of my main chart. The problem is that I have a SBR( 7000, 0 ) command that would limit the amount of days of bars to just 2-3 with the overnight bars.
I believe that means that I would need to have this running in another chart with perhaps 40 days of setup data to get to get enough bars for an accurate MACD Histogram of RTH data. To start with I need 4 times as many 24 hour days to get the same number of RTH bars. So if it required 10 days of setup data to get an accurate 60 minute timeframe MACD-H, it would require 40 days to start with to compress down to the same number of bars. That would be about 57K one minute bars, or 8 times the number of bars I have available on the main chart. It would make sense to run a chart at 15 minute timeframe from the 1 minute database as a starting point which would only require about 4K bars that then got compressed down to about 1K bars after removing the night session bars. Then a 30 minute and 60 minute MACD-H could be run over this data. The next step would be to expand it by adding the night bars back in. Saving this result to a static array should should timestamp the bars in a way that they can be read into the main chart and expanded to the one minute timeframe. I have never tried this, but that is my understanding of how it might work. Of course this operation can be faster with a little cleverness. For instance, since the static array already has the data available to the main chart after the first run, the entire conversion and calculation can be skipped if the results have not changed for the last bar. Just checking the values and timestamp of the last bar will determine if the previous results were still valid. Another approach is to just do the full calculation once a minute. In either case the calculation time would be drastically reduced. In this case a DLL would not be needed for speed. (Though I do have some other functions that really would benefit from a DLL -- I just need to stabilize the definitions) To make this work, the main chart would have to send the desired parameters to this slave chart via static variables. I have done this before. Does this sound right to you? BR, Dennis On May 18, 2010, at 5:15 AM, paultsho wrote: > If you are looking at option 3. the best way (from my opinion) is to copy the > elements of the array minus the out of hours bars. In this way, You are > creating your own DayNightCompress function. and You also need to create your > own DayNightExpand function. The beauty of this is that you can apply your > MACD or any indicator you like - very reusable. The coding is straight > forward, the resultant array is a shorter array of course, just like the > TimeframeCompress produces shorter arrays. > If running in afl loops is too slow, then consider a dll. a dll function > would have almost no speed penalty (ie, the extra time it takes to do that > compressing in relation to the TimeframeCompress is neglible, and you would > combine the DayNightCompress and TimeFrameCompress functionality together). > Ditto with the exapnd function. > If you think its a good concept but dont like the idea of coding C++, Let me > know, I could write one for you. > > --- In [email protected], Dennis Brown <se...@...> wrote: >> >> Paul, >> >> Thanks for the ideas. >> >> Multiple instances is not a good option for me since the instances would >> have to interact quickly, and it adds a level of complexity that would make >> ongoing maintenance of the system more difficult for me. >> >> Switching charts from 24 hour to day would be a great solution, except that >> all running charts on a sheet have this setting common to them. If it was >> unique to each chart tab, then I could do it easily. >> >> Writing my own custom indicator might work, but would be slow. I would have >> to generate a new timeframe, compress out the night data in a loop, do the >> MACD-H, decompress the data (put the night holes back in), then expand end >> back to the 1 minute timeframe. The only way for me to know for sure it >> would run fast enough and work without messing up the timestamps and is to >> code it and see. A lot of work if it does not do the job. >> >> I would appreciate any other insights about the gotchas I might encounter in >> doing the last option. >> >> Best regards, >> >> Dennis >> >> On May 17, 2010, at 9:27 PM, paultsho wrote: >> >>> the most obvious solution is to have 2 instances of AB, one for RTH and one >>> for 24 hours. the other option is to toggle the 24 hours/ Day trading only >>> mode in the display, but you cant have RTH and 24 hours in the same chart >>> though. The 3rd option is write custom MACD indicators that filters out out >>> of hours trading, and during this time, display no change (horizontal line). >>> cheers >>> paul. >>> >>> --- In [email protected], Dennis Brown <see3d@> wrote: >>>> >>>> Hello, >>>> >>>> I realized today that I need to combine indicators for my realtime trading >>>> strategy in an unusual way. >>>> I am looking for advice for an approach that might work. >>>> >>>> I am only charting in realtime indicator mode on one ticker symbol (ES >>>> futures). >>>> >>>> My database is 1 minute timeframe and 24 hours per day for about 18 months. >>>> >>>> My geometry indicators require this database setup spanning several days. >>>> >>>> However, I also need to generate an indicator for a MACD Histogram that is >>>> based on regular trading hours (RTH) in 30+ minute timeframes. This needs >>>> to span a few weeks of history for the calculation to be accurate. >>>> >>>> Of course speed is critical in that I am already bugged by the performance >>>> popup complaining that I am over 1000 quite often. I limit myself to 2000 >>>> setup bars and 5000 useful bars for realtime trading. I could stand to >>>> use more, but it runs too slow if I increase. >>>> >>>> I had been running this MACD-H indicator on 24 hour/day data, but found >>>> that it works much better in RTH only. >>>> >>>> I suppose if it were possible to have two charts running on the same >>>> database, but with different market hour settings, I could pass the MACD-H >>>> indicator data to the main chart through a static array. I don't think >>>> that is possible though. >>>> >>>> Thanks in advance, >>>> >>>> Dennis >>>> >>> >>> >>> >>> >>> ------------------------------------ >>> >>> **** IMPORTANT PLEASE READ **** >>> This group is for the discussion between users only. >>> This is *NOT* technical support channel. >>> >>> TO GET TECHNICAL SUPPORT send an e-mail directly to >>> SUPPORT {at} amibroker.com >>> >>> TO SUBMIT SUGGESTIONS please use FEEDBACK CENTER at >>> http://www.amibroker.com/feedback/ >>> (submissions sent via other channels won't be considered) >>> >>> For NEW RELEASE ANNOUNCEMENTS and other news always check DEVLOG: >>> http://www.amibroker.com/devlog/ >>> >>> Yahoo! Groups Links >>> >>> >>> >> > > > > > ------------------------------------ > > **** IMPORTANT PLEASE READ **** > This group is for the discussion between users only. > This is *NOT* technical support channel. > > TO GET TECHNICAL SUPPORT send an e-mail directly to > SUPPORT {at} amibroker.com > > TO SUBMIT SUGGESTIONS please use FEEDBACK CENTER at > http://www.amibroker.com/feedback/ > (submissions sent via other channels won't be considered) > > For NEW RELEASE ANNOUNCEMENTS and other news always check DEVLOG: > http://www.amibroker.com/devlog/ > > Yahoo! Groups Links > > >
