Hi All,

Somewhat of a theoretical question, but is it possible to set multiple buys and 
sells on a single bar within AFL code?

# # #
>From what I understand, I'm thinking not, because Sell[i], SellPrice[i], etc. 
>are singular elements, but figured I'd ask if there is a way to "game" the 
>arrays, possibly by not using the specific bar index of the actual trade 
>time???

say something like :

SellPrice[1] = sellPrices[5];
Sell[1] = True;

SellPrice[2] = sellPrices[17];
Sell[2] = True;

but could you then also set a SellTime[i] that the report system would 
understand?


# # #
While writing the above, I delved into the Custom Backtester's EnterTrade, 
which seems like it might work, but before I wander down a rabbit hole, anyone 
know if this would work?

{pseudo code}
{given}
bar = 15;
sig.symbol = "qqqq";
sig.IsLong = TRUE;

then...
priceA = 15;
ps = 1000;
bo.EnterTrade(bar, sig.symbol, sig.IsLong, priceA, ps);

priceA = 16;
ps = 500;
bo.EnterTrade(bar, sig.symbol, sig.IsLong, priceA, ps);

e.g. two opens on the same bar for the same symbol at different prices and 
sizes...

I always did like a challenge, 
Michael


Reply via email to