• C++ Programming for Financial Engineering
    Highly recommended by thousands of MFE students. Covers essential C++ topics with applications to financial engineering. Learn more Join!
    Python for Finance with Intro to Data Science
    Gain practical understanding of Python to read, understand, and write professional Python code for your first day on the job. Learn more Join!
    An Intuition-Based Options Primer for FE
    Ideal for entry level positions interviews and graduate studies, specializing in options trading arbitrage and options valuation models. Learn more Join!

Automating my strategies !!

I am new to this forum; I have been working on automating my strategies (scallpn equity srtgs) for few months now. I ended up learning to program in R (not good yet), but I have seen some r-packages and learning about tools to aid in programming.

What I am finding hard is transferring the knowledge/visuals into code (if/then statements). Mainly I have several factors/indicators that I use as guides to tell me whether the market is turning bullish or bearish. I want to play with models to optimize. I read a lot and so many options, but would like to hear from you guys.

tx
 
When I used to manual trade prop (scalping, for the most part), latency was my biggest issue-

Timing flips and getting your fill when the size prints without geeking out was pretty much my Achilles heel.

R will easily calculate stats - though for scalps I never got that deep: Look for size in the book and be the barnacle on the ship, hope for a stepper, as it were.

Without any idea what your strategies are, trending/momentum trades may be a better starting point.

You would probably be better served to pick up a more appropriate language for execution purposes (C++,Java,Python).

Just my $0.02 CAD
 
thanks gals and guys !!! I love the died bull Amanda
I will be looking at the links you provided sjain. :D

I will be a little more specific, if I have rules (parameters) regarding tick, trin, the ad line levels /trends, where the general market is compared to range...., would I be better off hard coding the rules into the code or should I spend the time and energy optimizing with "data training" tools such as neural networks, SMVs?

buy the way Amanda my trades are not ultrafast, they are mostly under 15 minutes in and outs, but they don't require the micro-second precisin
 
thanks gals and guys !!! I love the died bull Amanda
I will be looking at the links you provided sjain. :D

I will be a little more specific, if I have rules (parameters) regarding tick, trin, the ad line levels /trends, where the general market is compared to range...., would I be better off hard coding the rules into the code or should I spend the time and energy optimizing with "data training" tools such as neural networks, SMVs?

buy the way Amanda my trades are not ultrafast, they are mostly under 15 minutes in and outs, but they don't require the micro-second precisin

Jennifer, my open source mentor and leading R-finance quant, Brian Peterson, has created a set of packages for exactly what you want to do. It's called quantstrat. Google it up. I'll email you the documentation if you'd like.
 
Jennifer, I haven't seen machine learning techniques used to generate such signals. You should be able to incorporate your rules into signals using time series analysis tools included in these packages. I feel Machine learning techniques such as SVMs, boosting, etc are more applicable to cases where the underlying models are unknown, i.e. to uncover new models for pattern recognition, classification or ranking, and when data is of very high dimensions. You can find packages for ML studies in R on cran network.
 
Jennifer, I haven't seen machine learning techniques used to generate such signals. You should be able to incorporate your rules into signals using time series analysis tools included in these packages. I feel Machine learning techniques such as SVMs, boosting, etc are more applicable to cases where the underlying models are unknown, i.e. to uncover new models for pattern recognition, classification or ranking, and when data is of very high dimensions. You can find packages for ML studies in R on cran network.

You are probably right, I was hoping you can "guide" the AI to known factors, but I guess I might have been expecting too much of it.
 
For backtesting in R, following packages might be useful -
1. R stats package: contains everything from fitting distributions, PCA/factor analysis and estimation
http://stat.ethz.ch/R-manual/R-patched/library/stats/html/00Index.html
2. package containing most technical indicators functions such as MACD, RSI, etc..
http://cran.r-project.org/web/packages/TTR/TTR.pdf

Good luck. Let us know how it goes.

I have been looking for support and resistance code within TTR and within R in general, didn'n find it. Do you know if it exists?
thanks in advance yiou have been such a help !!!!
 
You are probably right, I was hoping you can "guide" the AI to known factors, but I guess I might have been expecting too much of it.

Jennifer,

You may want to look into grey box trading - basically packaged off the shelf (customizable) semi-automated solutions.

There are a few vendors out there (I can't think of names off the top of my head and I'm on my phone at the moment but if you google you should be able to find them)

Some of the prop shops offer this on their desks. From what I hear they tie into lightspeed well.
 
the problem with greyboxes is that you are trading their strategies. Early on in my trading I tried every trading filter there was; I liked none
i have many good strategies that I trade manually, and i like to explore and fine-tune.
I might be able to offer others a greybox service eventually. :cool::D

just a correction to my previous post to sjain. "I was hoping you could guide...." Instead of yoiu it should have been "one should be able to guide AI..." . And for clarificaton AI= artificial intel.
 

Yike Lu

Finder of biased coins.
As far as I know, the closest analog to support and resistance is moving min, moving max.

As far as pre-built packages, you need to be skeptical of backtest results that seem to be too good. I've seen some very bad look forwards hidden in R code. A very common pitfall is in using moving functions - many times a function will take e.g. the central moving average rather than the lookback moving average.
 
As far as I know, the closest analog to support and resistance is moving min, moving max.

As far as pre-built packages, you need to be skeptical of backtest results that seem to be too good. I've seen some very bad look forwards hidden in R code. A very common pitfall is in using moving functions - many times a function will take e.g. the central moving average rather than the lookback moving average.
Thanks, I agree I haven't see a good support and resistance built in def.
I was thinking about building one myself based on range tightining compared to time. Anyone tried something similar??
 
The fact that you call code "if/then statements" suggests to me you are a novice programmer, and are approaching this thinking of cutoffs, thresholds, and decision rules, instead of mathematical optimization. Check that your algorithm doesn't throw information away. Information is precious; use every bit of it.
 
Top