SmartQuant Discussion

Automated Quantitative Strategy Development, SmartQuant Product Discussion and Technical Support Forums
It is currently Fri Sep 25, 2020 8:49 pm

All times are UTC + 3 hours




Post new topic Reply to topic  [ 5 posts ] 
Author Message
PostPosted: Sat Oct 23, 2010 1:20 pm 
Offline

Joined: Sun Oct 17, 2010 2:26 am
Posts: 8
Hi, i used to code in mt4, i am moving away from mt4 because most mt4 broker is scam. After trying OQ, i like it this way it works. But i am confused on how to get value of indicators from OQ..i did search on forum but nothing comeup. Can some one please give me some sample:

- How to check rsi below/above 70/30 ?
- How to check Stochastic cross (main/signal) up/down and above/below 80/20 ?
- How to check Macd cross and above/below 0 ?
- How to check price above/below BolingerBand's High/low band ?

would be appreciated if you one can give me some sample.


Top
 Profile  
 
PostPosted: Sat Oct 23, 2010 1:30 pm 
Offline

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

have you looked through OpenQuant Straregy Development Guide? It discusses several strategies that use different indicators.

Regards,
Anton


Top
 Profile  
 
PostPosted: Sat Oct 23, 2010 1:34 pm 
Offline

Joined: Sun Oct 17, 2010 2:26 am
Posts: 8
Yes, i've read the maanual + sample code, but it doesn't mentioned on how to access macd, sto, rsi..if you can, please make quick snippets how to use indicators avaialble in OQ, so newbie like me can use as references.

Thanks

Dr. Anton Fokin wrote:
Hi,

have you looked through OpenQuant Straregy Development Guide? It discusses several strategies that use different indicators.

Regards,
Anton


Top
 Profile  
 
PostPosted: Sat Oct 23, 2010 2:24 pm 
Offline

Joined: Tue Aug 05, 2003 3:43 pm
Posts: 6817
You simply create an indicator object in OnStrategyStart()

sma = new SMA(Bars, 14);

use Draw method to draw it on Bar chart

Draw(sma, Color.Red);

and then you can use properties and methods of Indicator class in OnBar() event handler, for example

if (Bars.Count > 14) // <- to check you have enough entries to calculate SMA
if (sma.Last > 10)
Buy(...);

The same works for any indicator in OpenQuant.

======

from Indicator API references:

Public Properties
Name Description
Color Gets or sets indicator color
Count Gets the number of items in this indicator
Description Gets or sets indicator description
FirstDateTime Gets first date-time
Item Overloaded. Gets indicator value at specified bar
Last Gets last value of this indicator
LastDateTime Gets last date-time
Name Gets or sets indicator name
Width Gets or sets indicator width
Top
Public Methods
Name Description
Ago Returns n-bars-ago indicator value
Contains Overloaded. Checks if this indicator contains an entry with specified time stamp
Crosses Overloaded. Checks if this indicator crosses a bar series at specified bar
CrossesAbove Overloaded. Checks if this indicator crosses a bar series above at specified bar
CrossesBelow Overloaded. Checks if this indicator crosses a bar series below at specified bar
GetDateTime
GetIndex Returns index by specified date time


Top
 Profile  
 
PostPosted: Sat Oct 23, 2010 2:29 pm 
Offline

Joined: Tue Aug 05, 2003 3:43 pm
Posts: 6817
PS. Actually the Bollinger Bands strategy discussed in the Guide shows how to work with indicators

viewtopic.php?f=46&t=5204


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

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