[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

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.


>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.


>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.

Bob Fulks