[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 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:

BarLow = Low;

Then you are updating the value each bar. But if you say:

if XXXXX then BarLow = Low;

then you are only updating BarLow when condition XXXX is TRUE.

>You may also have a different problem with the "BarLow[1]".
>BarLow/BarHigh are the current values of BarLow/BarHigh and should be
>reset to a new value each time you enter a trade (long or short). 
>Sometimes TS does strange things with the back one value [1].  You may
>not get what you think you should get.

Not true. TradeStation interprets "Variable[1]" as the value of the 
variable one bar back. This is handy for things like prices, which 
change every bar. 

It is not necessary to use that form for variables that do not get 
updated bar to bar unless your code specifically updates then bar 
to bar.

Bob Fulks