Click here to Login





                                                   Buy a specific instrument via QS vector language

  0

0
clonex
2013-02-13 15:15:58


Hi,

if i want to buy a specific instrument ( in QS vector language), which function must I use?

buy = GetSeries("SPY",close,LastData); ?

is there better/another function?

Thanks,


Clonex



QuantShare
2013-02-14 16:22:36

  0

Hi,

The formula is analyzed for each symbol. If you want to buy "SPY" then you must include that ticker in the symbols list of your trading system.




clonex
2013-02-14 16:31:12

  0

Thanks ,

and if i have SPY and GLD in symbol list

and if ill write

buy = GetSeries("SPY",close,LastData) and GetSeries("SPY",close,LastData) > sma( GetSeries("SPY",close,LastData),10);

it is correct?

Thanks

Clonex



QuantShare
2013-02-14 16:41:39

  0

I don't know why you are adding the first "GetSeries("SPY",close,LastData)".

It should be:
buy = GetSeries("SPY",close,LastData) > sma( GetSeries("SPY",close,LastData),10);

And in that case the trading system will enter long SPY and GLD if SPY is above its moving average.





clonex
2013-02-14 16:44:13

  0

Yes i understand but if I want to buy only SPY it is possible via QS vector language?

Thank You,

Clonex



QuantShare
2013-02-14 17:00:27

  1

Just add the following condition:
stringequal(name(), "SPY")




clonex
2013-02-14 17:03:14

  0

YES!

this is what i looking for!

Thanks!

Clonex



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
Buy Indicator
Buy Sell Simulation Indicator
Capital Allocation based on Moving Average position on Instrument
Indicator/Price Value on a Specific Trading Date
Trading Strategy based on the Number of Buy Signals

How-to Lessons
How to draw an horizontal segment line using QS language
How to download historical quotes of indices
How to import trades into a portfolio
How to create a strategy-based portfolio
How to set order type of a trading system programmatically

Related Forum Threads
Only Specific Instrument in Simulator
Buy at a specific intra-bar price
Performance of parsing a QS language function in AMM
Build up a position over a specific time period
Backtest Buy Open/Sell Close Every Day

Blog Posts
A vector-based language
QuantShare Programming Language Tutorial
Buy the best/top rated stocks or how to create powerful rank base...
How to create buy and sell trading rules based on News Data
Trading System: Moving average crossover and few others buy and s...









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.