Thanks, I actually copied the code in the exploration AFL. My code uses a FOR statement to fill in the Buy and Sell signals. When I run the exploration for one symbol, it displays all the trading days. I want the exploration to show only the last bar, so that I can add other symbols and there will be one line per symbol.
How can I just show the latest bar but still run the strategy for the previous bars? --- In [email protected], "Mike" <sfclimb...@...> wrote: > > You can either add the exploration code to the existing strategy code, or > #include_once the strategy file into a new exploration file. > > http://www.amibroker.com/guide/afl/afl_view.php?name=%23include_once > > One way to determine whether or not you are in a position is to use the Flip > function. > > http://www.amibroker.com/guide/afl/afl_view.php?id=51 > > Example; > > Buy = ... > Sell = ... > Short = ... > Cover = ... > > AmLong = Flip(Buy, Sell); > AmShort = Flip(Short, Cover); > > // Output "L" when long, "S" when short, "F" when flat. > Filter = 1; > AddColumn(IIf(AmLong, Asc("L"), IIf(AmShort, Asc("S"), Asc("F"))), > "Position", formatChar); > > Mike > > --- In [email protected], "lucianomt" <lucianomt@> wrote: > > > > I want to use the Exploration function to screen a watch list for Buy/Sell > > signals generated by a strategy I already have. The Exploration list should > > show the symbols and whether I am long, short or flat that symbol according > > to the strategy. > > > > Do I have to replicate the strategy code on the exploration code or can I > > just refer to that strategy? If so, how? > > >
