Click here to Login





                                                   How to read the number of positions in trading system

  0

0
Piotr
2014-08-15 04:59:25


I have a trading system based on ranking. I want to optimize the number of open positions. To do this, I need to read in my buy/sell formulas the number of max open positions, being the setting of the system. I used the code:

numPositions = GetSimSetting(_NbPositions);
buy = ranking <= numPositions;
sell = ranking > numPositions;

Obviously, this does not work. When I set the number of positions in script manually - it generates completely different results. System only buys stocks with name starting with 'A'
Please help

Regards




QuantShare
2014-08-15 05:38:26

  0

If you want to rank securities based on variable ranking then use:
SetSimLongRank(ranking);

If you want to perform advanced ranking, then use the "comp" function.
http://www.quantshare.com/sa-175-trading-indicators-using-the-rank-and-percentile-functions



Piotr
2014-08-15 07:33:09

  0

Sorry, maybe I was not clear. I already use comp function and I found this function a great development. My problem is rather with GetSimSetting(_NbPositions).

To optimize number of positions, I need to know in my strategy script the value of "Number of symbols" for current optimization run. I wanted to read this value by GetSimSetting, but it does not work for me.

So I need to know, how to get this value

Regards



QuantShare
2014-08-15 11:03:36

  0

You need to use the money management script to know the current number of open positions.

GetSimSetting(_NbPositions) will only get the number of positions you specified in the trading system settings.

You can also optimize the number of positions directly in your trading system's formula.



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
Minimum Number of Positions in a Trading System
Adaptive Trading System - Percent Winning Trades for the Last N-D...
Trading System based on the Linear Regression of the RSI Indicato...
Trading Strategy based on the Number of Buy Signals
Ratio of the Short to Long-Term Moving Averages - ETF Trading Sys...

How-to Lessons
How to optimize the number of positions in a trading system
How to add a metric in the trading system simulation report
How to debug a trading system using the money management tool
How to optimize the stop limit of a trading system
How to dynamically change the number of positions in a portfolio?

Related Forum Threads
Add a trading system to the price volume chart
How to determine if the a given day is a trading day?
How to edit a trading system i've downloaded from shared server?
Help with the following trading system
Trading system optimization using the QuantShare API Simulator

Blog Posts
How to Select the Best Market Indicator for your Trading System
How to Create an Automated Trading System in QuantShare
How to Optimize a Trading System with Thousands of Billions of Co...
How to Switch On/Off Trading Rules in Your Stock Trading System
How to build and backtest a robust stock trading system









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.