[R-SIG-Finance] Position Limits

Joshua Ulrich josh.m.ulrich at gmail.com
Sun May 29 18:23:42 CEST 2016


On Fri, May 27, 2016 at 3:48 PM, John Klingensmith <johnsk00 at gmail.com> wrote:
> Hi,
>  I am relatively new to R and QuantStrat, etc. I am playing with a real
> simple strategy that goes long when the market closes at its lowest close
> in 3 days and reverses the position when the market closes at its highest
> close in 3 day.  I am trying to limit the position size to 1 lot in either
> direction by using osMaxPos and addPosLimit, but for whatever reason the
> position limits are not getting imposed. I also read the "Long Enter
> Position do not "block" Short Enter Orders" question and tried making a
> custom function.
>
> My questions are as follows:
<snip>
>
> 4) I am using S&P index data; although you cannot actually trade the index,
> it is a good proxy for what I am trying to test. When I download the index
> data (symbol ^GSPC) the symbol stored is "GSPC" without the carrot;
> therefore, I cannot simply use "symbols <- "^GSPC" and reference "symbols"
> in my code as I would normally if it were an ETF. Can someone explain why
> this is?
>
Because syntactic names must start with a letter, or a period not
followed by a digit.  See the "Names and Identifiers" section of
?Quotes.

> Thanks for any help.
> Best,
>  John
>
>         [[alternative HTML version deleted]]
>
> _______________________________________________
> R-SIG-Finance at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-sig-finance
> -- Subscriber-posting only. If you want to post, subscribe first.
> -- Also note that this is not the r-help list where general R questions should go.



-- 
Joshua Ulrich  |  about.me/joshuaulrich
FOSS Trading  |  www.fosstrading.com
R/Finance 2016 | www.rinfinance.com



More information about the R-SIG-Finance mailing list