Click here to Login





                                                   custom field value is function beta sma

Back to threads - Tags: --
  0

0
Bob Parsons
2013-09-08 17:58:35


Hello,

Any suggestions on how to calculate % change, 20 day moving average, and beta (based on 252 trading days, S&P500 as benchmark index) and add these calculations to the quotes database for each symbol? I would like to export the quotes from the quotes database as well as these indicators to a csv file using the script editor (currently i have a script to do this for all the fields in quotes, but i can't figure out how to add custom fields to the quotes database and add custom functions for a custom field. Any help would be greatly appreciated, thanks.



QuantShare
2013-09-09 19:17:52

  0

Hi Bob,

You can calculate these indicators in the script editor and export them like you do with the quotes database.

Here is how to calculate the % change 20-day MA:
Parser parser = ParserTool.CreateParser("a = perf(sma(20), 1);");
// Loop through each symbol
Report report = parser.Parse("Symbol Name", 1, true);
double[] data1 = report.GetArray("a");

For the beta, you can do the same but first you must download the beta indicator: Beta






Beta (by Stefan Kroscen, uploaded several months ago)
No notes

Rate an item Rate an item Rate an item Rate an item Rate an item Number of downloads Notes Report an item

No more messages
0




Reply:

No html code. URLs turn into links automatically.

Type in the trading objects you want to include: - Add Objects
To add a trading object in your message, type in the object name, select it and then click on "Add Objects"










QuantShare

Trading Items
Sum of a Custom Database's Field
Advanced Quotes and Custom Databases Function
News parser function
Lagged Data From a Custom Database
Indicator/Price Value on a Specific Trading Date

How-to Lessons
How to quickly select stocks based on the last value of a databas...
How to create a custom trendline
How to add custom position-based metrics to your trading system
How to create a custom trading indicator
How to use a custom drawing tool

Related Forum Threads
Monthly/weekly summation for a custom database field
Problem with performance calculation in custom function
Candle Stick Ratio Plot custom function
Custom Fitness function in Ranking System Manager
Passing date variable from custom drawing tools to custom functio...

Blog Posts
How to Create a Custom Real-Time Table using QS Trading Software
Trading System Analysis: Backtesting report and custom measures
How to create market indicators using the composite function - Pa...
Custom Indicator: Accumulation Distribution Line
The custom trading indicators tool explained









QuantShare
Product
QuantShare
Features
Create an account
Affiliate Program
Support
Contact Us
Trading Forum
How-to Lessons
Manual
Company
About Us
Privacy
Terms of Use

Copyright © 2024 QuantShare.com
Social Media
Follow us on Facebook
Twitter Follow us on Twitter
Google+
Follow us on Google+
RSS Trading Items



Trading financial instruments, including foreign exchange on margin, carries a high level of risk and is not suitable for all investors. The high degree of leverage can work against you as well as for you. Before deciding to invest in financial instruments or foreign exchange you should carefully consider your investment objectives, level of experience, and risk appetite. The possibility exists that you could sustain a loss of some or all of your initial investment and therefore you should not invest money that you cannot afford to lose. You should be aware of all the risks associated with trading and seek advice from an independent financial advisor if you have any doubts.