SmartQuant Discussion

Automated Quantitative Strategy Development, SmartQuant Product Discussion and Technical Support Forums
It is currently Wed Sep 23, 2020 11:32 am

All times are UTC + 3 hours




Post new topic Reply to topic  [ 6 posts ] 
Author Message
PostPosted: Fri Feb 07, 2014 12:52 pm 
Offline

Joined: Wed Aug 08, 2007 6:32 pm
Posts: 236
How do I specify which instrument an indicator should be built on?


Top
 Profile  
 
PostPosted: Fri Feb 07, 2014 12:57 pm 
Offline

Joined: Tue Aug 05, 2003 3:43 pm
Posts: 6817
Hi,

you attach indicator to a time series, but not directly to an instrument. Could you tell us what you are trying to achieve?

Regards,
Anton


Top
 Profile  
 
PostPosted: Mon Feb 10, 2014 5:39 pm 
Offline

Joined: Wed Aug 08, 2007 6:32 pm
Posts: 236
Hi, I am analysing one market (instrument1) and trading in another (instrument2). So I only want to run an indicator on instrument1 not both.

Even if it must calculate an indicator for both instruments, which is inefficient but I can live with, I am unsure how to reference the indicator for instrument1 only.

Regards


Top
 Profile  
 
PostPosted: Tue Feb 11, 2014 9:33 am 
Offline

Joined: Tue Aug 05, 2003 3:43 pm
Posts: 6817
Hi,

something like this?

public static Instrument indicator_instrument;
public static Instrument trade_instrument;

OnStrategyStart()
{
indicator_instrument = Instruments["MSFT"];
trade_instrument = Instruments["AAPL"];

if (instrument == indicator_instrument)
// create indicator
}

OnBar()
{
if (Instrument == indicator_instrument)
// check entry condition
}

Regards,
Anton


Top
 Profile  
 
PostPosted: Tue Feb 11, 2014 10:19 am 
Offline

Joined: Wed Aug 08, 2007 6:32 pm
Posts: 236
Hi Anton, will try that.

BTW does that mean OnStrategyStart is instrument specific somewhat similar to OnBar.

Regards


Top
 Profile  
 
PostPosted: Tue Feb 11, 2014 10:47 am 
Offline

Joined: Tue Aug 05, 2003 3:43 pm
Posts: 6817
Yes, it's called for every instrument.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 6 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