SmartQuant Discussion

Automated Quantitative Strategy Development, SmartQuant Product Discussion and Technical Support Forums
It is currently Tue Mar 19, 2019 8:52 am

All times are UTC + 3 hours




Post new topic Reply to topic  [ 16 posts ]  Go to page Previous  1, 2
Author Message
 Post subject:
PostPosted: Mon Oct 27, 2008 8:47 pm 
Offline

Joined: Thu Jun 08, 2006 3:56 pm
Posts: 537
Location: BC Canada
Hi Anton, I am using both range bars and 1min bars in a strategy, and I used your GetBars technique below to force my indicators to use the range bars, as follows:
Code:
// Anton's method from this thread above
// SMA sma = new SMA(GetBars(600),  14);

// My use of the method, specifying BarType too
Mac = new MACD (GetBars (BarType.Range, 10000), 12, 26, BarData.Close);


The GetBars method worked beautifully. What a nice interface design that allows you to use GetBars to specify which series to bind to an indicator!

I was also impressed to see that my zero line indicator appeared on the correct chart too. I feed the zero line indicator the bar.DateTimes from the range bars, and the zeroline shows up correctly with the MACD on the range barchart, as follows:

Code:
    // set up indicator series
    zero_line = new TimeSeries ();
    zero_line.Color = Color.Black;
    Draw (zero_line, 2);

OnBar() {
    // show a zero line on the range bar chart
    zero_line.Add(range_bar.DateTime,0);

   // show a zero line on the 1min bar chart
   zero_line.Add(OneMinuteBar.DateTime,0);
}


The zeroline does not show up on the 1min barchart unless I feed it a bar datetime from the 1 minute series.

I have to say what a nice design and implementation this is, making sure that all the indicators show up on the right chart by examining the bar types/sizes that are used to feed the indicators. A very good job in the details, IMHO.

I appended this info to this thread because it seems to be a good thread on handling multiple bar types/times and multiple indicators within one strategy.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 16 posts ]  Go to page Previous  1, 2

All times are UTC + 3 hours


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB® Forum Software © phpBB Group