[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Help with coding an initial stop loss



PureBytes Links

Trading Reference Links


Bob Fulks wrote:
> 
> At 05:28 PM 11/2/2005, you wrote:
> 
> >Bob Fulks wrote:
> >>
> >> At 01:01 AM 11/2/2005, Larry wrote:
> >>
> >> >Also, unless you are just back testing you will need to use Global
> >> >Variables in order to pass the BarLow and BarHigh values to the next day
> >> >unless you leave your computer on all the time.
> >>
> >> Not true. The values are maintained bar to bar until you change
> >> them. If you simply say:
> >
> >Absolutely not true - variables are only maintained as long as the
> >program is running. Shut down the program or turn off the computer and
> >all the program variables are gone.
> 
> You are correct. If your computer is off, you cannot look at the
> values of variables unless you happened to have written them down on a
> piece of paper...
> 
> But turn it back on and reload the data and the values are exactly as
> they were when you turned it off.
> 
> >If all he is doing is back testing - then the values will, of course, be
> >maintained through the test.  If he is trying to run his strategy on a
> >day to day basis in real time with real data AND shuts off his computer
> >or the program after the run - the values ARE gone.
> 
> Not correct. The past OHLC data is stored on your hard drive so when
> you turn the computer back on, it reloads the existing data and
> everything is back where it was.
> 
> Perhaps you are referring to the problems you can get into if you
> design your system to depend upon the exact order that data occurs
> within a bar (such as entering and exiting on stops on the same bar).
> If that is what you are referring to, you can "test within the bar" to
> whatever resolution you desire to avoid this problem.

If you have decided to code your systems so that you must run Monday's
data again on Tuesday to get a value that you had on Monday so that you
can start trading on Tuesday with that value then you are correct -  the
question is why would you?  The simple way is just pass the value along
and not re-run the same data again and again and keep adding to the data
that must be run again and again.

In one Forex system that I use I need the direction of my GOD closing
trade on Friday - was I long or short when I closed the position for the
weekend - never hold a position over the weekend - this direction is
based on the complete week's trading.  As I run this on tick data your
way would have me re-run the entire weeks worth of tick data to arrive
at the value that I need to start with on Sunday for each currency that
I'm running.  My way - collect the value on Friday and pass that value
to Sunday's start.  Sunday's start 'reads' the value from the Global Var
that was 'written' on Friday and you're off and running.  Which is
simpler re-run a weeks worth of tick data for each currency or pass
along one value with a Global Var?
 
> >Many things that work in back testing such as passing along variables
> >from one day's data to the next day's run do NOT work in the real world
> >with real data.  Now he is aware of at least some of the problems with
> >taking a system that back tests and trying to apply that system to real
> >data.
> 
> Totally wrong. All variables retain their values from bar to bar
> until you change them in your program.
>
> >If he is going to try to take his system into the real world then he
> >will need to pass the 'BarLow'/'BarHgh' value information from Monday's
> >run, to Tuesday's run, to Wednesday's run etc.  Which is easily done
> >with Global Variables.
> 
> He does not need Global variables to do that. It has always been
> the normal operation of TradeStation. Try a simple test:
>
> if CurrentBar = 1
>    then Value1 = 100
>    else Print(CurrentBar, Value1);
> 
> You will see that it prints 100 for all bars.

The caveat is very simple - your way - all data must be re-run to
re-establish the needed vars.  My way - collect the var and pass it
along to the next day - no need to re-run any data. 

> >If he is happy with developing systems that run well on historic data
> >and content to see the results of what would have been if he only would
> >have been trading for real - would've, could've, should've, - then I
> >have very little interest in trying to help him.
> 
> Sorry. I do not get your point here. Obviously, market prices in the
> future are never exactly like prices in the past but certainly if a
> system does not work well on past data, there is no chance it will
> work well on future data.

Well lets see if I can make it clearer - over the course of the last
several years - (I still have one of original Omega products, "Wall
Street Analyst" from 1996 and my original dh's of "WOW" from the company
that Omega bought just to get their code) - my partner and I have joined
just about every discussion, form, list, user group, whatever that we
could find - reading the posts - sometimes interacting with the posters
- meeting with users - even on occasion interacting with each other to
spur along a dialog to get others to post - on the rare occasion that we
were on the same form. 

We arrived, independently, at the same conclusion - most of the people
that have TS are either looking for a system to use or are writing
systems that will never see the light of day or have a copy of TS but
don't have a clue what to do with it.  They keep trying to write or find
the Holy Grail - they keep tweaking and tweaking and back testing and
back testing but never never risk a trade. 

TS claims that it has sold, depending on which numbers you want to
believe, up to 50,000 copies of the TS product line - where the hell are
all the users?  If 50,000 people were actively using TS you couldn't
swing a dead cat without hitting a TS trader.

I don't deal well with - would've, could've, should've, "traders".

Larry