Click here to Login





                                                   Detect flat positions

  0

0
clonex
2012-02-08 06:15:36


It is possilbe direct from strategy detect that positions are flat? My idea is, when i have flat poisitons in instrument a then i want to buy instrument b.
It is possibe via QS vector language?

Clonex



QuantShare
2012-02-08 06:30:46

  0

You have to use the money management script to detect flat positions and trade based on that.

In the simulator, the QS formula is calculated to generate signals only. If you want to interact with the portfolio then you must use the advanced money management tool.



clonex
2012-02-08 06:50:45

  0

And could you give a simple quide ( or pseudo code) for this process?

thanks



QuantShare
2012-02-09 05:57:13

  1

Best Answer
Here is an example:

It gets all trades closed during the current period and then checks if there are not active position for each security.

MMPosition[] closedPositions = Portfolio.GetLastClosedPositions(); // Get last transactions
for(int i=0;i < closedPositions.Length;i++)
{
string symbol = closedPositions[i].Symbol;
if(Portfolio.GetPosition(symbol) == null) // No position for this symbol
{
// Buy something
}
}



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
Holding period return - classifying positions
Detect and Display Potential Splits on a Chart
Flat Market Indicator
Volume near Price Level - Detect Strong Support & Resistance Area...
EURUSD Long Positions Ratio

How-to Lessons
How to detect stocks trading near all time highs
How to dynamically change the number of positions in a portfolio?
How to optimize the number of positions in a trading system
How to quickly add several positions to your portfolio
How to detect whether price movements are predictable or not

Related Forum Threads
Different Stops for Long/Short Positions
Holding Constant Positions
How to define an alternate asset to buy when no positions are hel...
How to read the number of positions in trading system
No overnight positions

Blog Posts
How to Detect Potential Issues/Errors in Your Historical Data?
How to Create Custom Metrics for Your Trading Positions
Detect chart patterns using the auto support/resistance indicator
Trend following systems
Long Term Trading with Technical Analysis









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.