SmartQuant Discussion

Automated Quantitative Strategy Development, SmartQuant Product Discussion and Technical Support Forums
It is currently Tue May 21, 2019 5:33 am

All times are UTC + 3 hours




Post new topic Reply to topic  [ 3 posts ] 
Author Message
PostPosted: Tue Dec 04, 2007 6:28 pm 
Offline

Joined: Wed Nov 28, 2007 8:04 pm
Posts: 7
Location: Jersey (C.I.)
Hi there,
I have created a very simple strategy just to plot the SMA and SMD indicators. My market data intervals are set to '5min' and 'Daily'. I am using one instrument.

After running the strategy, the indicators are only drawn for the '5min' data and not the 'Daily' data. Charts attached below.

Am I doing something wrong?
An answer to this would be really useful because my strategy combines indicators calculated over different intervals.

Thanks!

Matt
Code:
using System;
using System.Drawing;

using OpenQuant.API;
using OpenQuant.API.Indicators;

public class MyStrategy : Strategy
{
   SMA avg;
   SMD vol;

   public override void OnStrategyStart()
   {
      vol=new SMD(Bars,32);
      vol.Color=Color.White;
      Draw(vol,3);

      avg = new SMA(Bars, 10);
      avg.Color = Color.Aqua;
      Draw(avg, 2);

   }

   public override void OnBar(Bar bar)
   {
   }
}


Attachments:
File comment: But viewing the chart at a 'Daily' interval and the indicators aren't displayed.
Daily.jpg
Daily.jpg [ 175.48 KiB | Viewed 3946 times ]
File comment: Viewing the chart at '5min' interval and we can see the 2 indicators.
5min.jpg
5min.jpg [ 162.96 KiB | Viewed 3946 times ]
Top
 Profile  
 
 Post subject:
PostPosted: Tue Dec 04, 2007 6:42 pm 
Offline

Joined: Tue Aug 05, 2003 3:43 pm
Posts: 6812
Your indicator is attached to default bar series (Strategy.Bars). If you want to attach it to a different series (with different bar type / size), you shoud use

Strategy.GetBars(barType, barSize);

instead of Bars.

Regards,
Anton


Top
 Profile  
 
 Post subject:
PostPosted: Tue Dec 04, 2007 7:10 pm 
Offline

Joined: Wed Nov 28, 2007 8:04 pm
Posts: 7
Location: Jersey (C.I.)
Thank you!


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 3 posts ] 

All times are UTC + 3 hours


Who is online

Users browsing this forum: No registered users and 2 guests


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