Basis price for Position entry cannot be zero (Error message)
Author: Ben_Zurich
Creation Date: 8/22/2012 8:03 AM
profile picture

Ben_Zurich

#1
Recently I had the error message

QUOTE:
Basis price for Position entry cannot be zero


which appeared while executing statements such as

CODE:
Please log in to see this code.

CODE:
Please log in to see this code.


When trading Future Spreads you have the situation where prices can be positive, zero or negative. It seems that WL6 allows to trade bars with negative pricing, but not those with a price of zero (i.e. when
CODE:
Please log in to see this code.
).

As a circumvention, I have preceeded above statements by

CODE:
Please log in to see this code.


and back again after the market order.
profile picture

Eugene

#2
The error message is pretty self-descriptive: position sizing can not be done and so the program halts. It is simply impossible to calculate the position size if the current price is zero.
profile picture

Eugene

#3
For more information on the subject, please re-read this User Guide chapter:

Strategy Window > Backtesting Strategies > 100% of Equity Sizing > Basis Price
profile picture

Ben_Zurich

#4
I see. Is there a possibility to use the margin requirement of the Base symbol as a means for automatic position sizing?
profile picture

Cone

#5
QUOTE:
use the margin requirement of the Base symbol as a means for automatic position sizing?
For sure futures margin is used in position sizing, but what do you mean by "automatic"?

It's true that generally you can create trades for instruments with negative pricing, but some (many?) performance metric calculation do not take this into account. For this reason we've always said that negative pricing is not supported.
profile picture

Eugene

#6
profile picture

Ben_Zurich

#7
Thank you, but neither of these posts refer to position sizing (They refer to peeking and other problems).

I will now try to use the WealthScript Override (SetShareSize) in the case of spread trading simulation.
profile picture

Cone

#8
I still don't know what you mean about auto position sizing, but if you're going to use SetShareSize, the SymbolInfo object will come in handy.

CODE:
Please log in to see this code.
profile picture

Ben_Zurich

#9
By that I mean nothing else as what WL6 does all the time: automatically size the position for trades according to the chosen position size option.

In case of spreads (and futures also), in my case, position sizing is a combination of maximum risk to be taken per trade and either margin requirements, or, if known, expected maximum drawdown. The latter can be obtained by such websites as
http://www.mrci.com
http://www.scarrtrading.com
http://www.seasonalfuturescharts.com
profile picture

aerenton

#10
I have a problem with the Strategy Monitor using Yahoo´s Ibovespa data. It shows the message "Basis price for Position entry cannot be zero". When you look at the chart, you see that the last price is zero for several stocks.Is there a problem with the data provider? Anything we can do to solve this? I tried to update the data, but the problem persists.
profile picture

Eugene

#11
I just verified that there are no missing bars in Yahoo's free Bovespa data. Must be a temporary or local issue (which is offtopic in this thread). Simply updating the data will not work, you should reload the data instead. The quickest way is to use the Data Tool addin yet you can do using WL's built-in tools:

1. Highlight the "Brazil Bovespa" DataSet
2. Click "Symbol Details"
3. Click on the first symbol, then use keyboard shortcut Shift-End to select all symbols (or do this with your mouse)
4. Right-click on the selection and choose "Reload symbol data file". The cached data is purged.
5. Update the DataSet to reload the data from scratch.



P.S. Often, questions have been discussed before and answers can be found as you type by entering a few keywords in the "Search Forum..." text box. That's what I did, moving your post to a closely matching thread (there's been four, each dedicated to this very error message). Give it a try next time and you'll be amazed how efficient can our self-help be to solve problems.
This website uses cookies to improve your experience. We'll assume you're ok with that, but you can opt-out if you wish (Read more).