|
TJ:
The sample code didn't work. I did a trace of the
scaleIn signals, and found:
1. the scaleIn signals were not sorted by
PositionScore but by alphanumeric order.
2. actually the PosScore and RoundLotSize is EMPTY
for scaleIN signals.
3. I still had the 1e+010 shares problem when using
scaleIn.
(To compare, I removed the scaleIn code and
changed sig.IsScale() to sig.IsEntry(), the trace showed that the entry
signals were sorted as expected)
Thanks,
-Mark
if (sig.IsScale() AND sig.Price != -1 AND
IsNull( bo.FindOpenPos( sig.Symbol ) ) ) { // Entry Signal _TRACE("Entry " + sig.symbol + " " + NumToStr(sig.PosSize) + "/" + NumToStr(sig.PosScore) + "/" + NumToStr(sig.RoundLotSize) + "@ $" + NumToStr(sig.Price)); if( bo.EnterTrade(bar, sig.symbol, sig.IsLong(), sig.Price,sig.PosSize,sig.PosScore,sig.RoundLotSize) == 0 ) { // if certain trade can not be entered due to insufficient funds // or too small value (less than MinPositionValue) or // to few shares (less than MinShares" // then do NOT process any further signals bContinue = False; }
|
- Re: [amibroker] Why portfolio backtester does not consider... Mark H
- Re: [amibroker] Why portfolio backtester does not con... Tomasz Janeczko
- Re: [amibroker] Why portfolio backtester does not con... Mark H
- Re: [amibroker] Why portfolio backtester does not... Tomasz Janeczko
- Re: [amibroker] Why portfolio backtester does not... Tomasz Janeczko
- Re: [amibroker] Why portfolio backtester does... Mark H
- Re: [amibroker] Why portfolio backtester ... Tomasz Janeczko
- Re: [amibroker] Why portfolio backtester does not con... Mark H
