Skip to content

Commit 96c6de4

Browse files
authored
Update 20 Order Response Error Reference.php
1 parent 31fd4db commit 96c6de4

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

03 Writing Algorithms/22 Trading and Orders/10 Order Errors/20 Order Response Error Reference.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -280,13 +280,13 @@
280280
<p>To avoid this order response error, check if there are enough shares available before you place an order to short a security.</p>
281281

282282
<a id='invalid-new-order-status'></a><div class="section-example-container">
283-
<pre class="csharp">var availableToBorrow = ShortableQuantity(_symbol);
284-
if (availableToBorrow == null || quantityToBorrow <= availableToBorrow)
283+
<pre class="csharp">
284+
if (quantityToBorrow <= ShortableQuantity(_symbol))
285285
{
286286
MarketOrder(_symbol, -quantityToBorrow);
287287
}</pre>
288-
<pre class="python">available_to_borrow = self.shortable_quantity(self._symbol)
289-
if available_to_borrow == None or quantity_to_borrow <= available_to_borrow:
288+
<pre class="python">
289+
if quantity_to_borrow <= self.shortable_quantity(self._symbol):
290290
self.market_order(self._symbol, -quantity_to_borrow)</pre>
291291
</div>
292292

0 commit comments

Comments
 (0)