Move everything back one day. For example, instead of close(0), make it close(-1). Instead of stochrsi(0)>30, you'd have stochrsi(-1)>30.
If you want to get more adventuresome, sling a for loop in there. For a basic for loop, you need to:
1. Declare the variable:
integer i;
2. Define the loop:
for i = -2 to 0 step 1 do
3. Put i in the scan function:
close(i) or stochrsi(i)
4. Add a "next i" after the print statement.
Here's an example:
output="test.lst"; Daystoload=500; integer i;
for i = -2 to 0 step 1 do
set stochrsi = 8, 8, 5, e;
if stochrsi(i)>30 and stochrsi(i-1)<30 then println symbol , ", ", stochrsi(0); endif; next i;
|