You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When I backtest multiple strategies, I am sometimes shown the error message below:
The difference between what we have raised with q and
the amount we are trying to raise has gotten bigger since
last iteration! full_outlay should always be approaching
amount! There may be a case where the commission fn is
not smooth
I went into the code and debugged. I was in a situation where self.integer_positions = True and
full_outlay < full_outlay_of_1_more < amount
In this particular situation, given that I can buy one more unit, the quantity should go up by one unit q+=1.
This would therefore lead to a new full_outlay that is much more closer to amount (but still inferior) which would then lead to the condition np.abs(full_outlay - amount) > np.abs(last_amount_short) to be False and therefore would not trigger the error message.
It appears that this situation is not taken into account in the code If full_outlay < full_outlay_of_1_more < amount then no action is taken to update the quantity nor the full_outlay.
This situation can definitely happen ! Reach out for more details.
This is an annoying error message that I have also struggled with. But looking at the code I can't replicate what you are describing/see how that is possible. There is a loop which increases the amount until the condition is satisified. The escape condition below would seem to require that full_outlay_of_1_more>amount
Hi,
When I backtest multiple strategies, I am sometimes shown the error message below:
I went into the code and debugged. I was in a situation where
self.integer_positions = True
andIn this particular situation, given that I can buy one more unit, the quantity should go up by one unit
q+=1
.This would therefore lead to a new
full_outlay
that is much more closer toamount
(but still inferior) which would then lead to the conditionnp.abs(full_outlay - amount) > np.abs(last_amount_short)
to be False and therefore would not trigger the error message.It appears that this situation is not taken into account in the code If
full_outlay < full_outlay_of_1_more < amount
then no action is taken to update the quantity nor the full_outlay.This situation can definitely happen ! Reach out for more details.
The text was updated successfully, but these errors were encountered: