Every day with profit target
Author: EJoub
Creation Date: 12/18/2013 7:11 PM
profile picture

EJoub

#1
The wizard can’t write code for the rules below. (Maybe it is only my lack of insight) Trying to find partial examples for this amongst the Strategies I have downloaded or partial examples from WealthScript Programming Guide, wasn’t successful.

Can I get some assistance please...manual intraday trading is a real dog...on some instruments.

Sell at limit “x %” above lowest price of yesterday.
Buy at limit “y %” below yesterday’s highest price.
A stop at "z %".
Parameters x,y and z to have variables for optimization.

It is probably the oldest strategy around but I have to play with this to see where discretion is required.
This will hopefully trade every day, if buy and sell conditions are met. I have used the wizard but could only use ROC to do above but it is not close enough...it’s obviously not using highest and lowest prices.

The other dynamics I can find during backtesting.

Related to above...is it possible for code to beat (Re profits and risks) manual intraday trading?
This is probably an unfair question...not to compare apples with apples.
But backtesting with WL is super...until I get a really good strarategy.
profile picture

Eugene

#2
You can't run this system on Daily data for reason explained in this FAQ (at least not without using a solution mentioned in the same FAQ which is called "Setting Priority for AtStop/AtLimit Orders"):

I want to test a strategy that buys and sells with stop/limit orders on the same bar.

Consequently, the code runs on intraday data only:

CODE:
Please log in to see this code.
profile picture

EJoub

#3
Thank you for the code...there is no way I could have written that.

On intraday data with the stop removed and using only a single symbol, it just indicated once again that buying low and selling high strategies are only good for flat markets and small gradients.

What is the best solution for the above problem?
This website uses cookies to improve your experience. We'll assume you're ok with that, but you can opt-out if you wish (Read more).