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" <lucian...@...> 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?
>


Reply via email to