My BuyAtLimit logic
Author: deepbuyer
Creation Date: 9/26/2009 7:29 PM
profile picture

deepbuyer

#1
CODE:
Please log in to see this code.


I seem to be having problems with this piece of code:
CODE:
Please log in to see this code.


As an example, I ran the code above and collected trades with entries labelled "BuyLimit". Next, i commented out one line and uncommented another:
CODE:
Please log in to see this code.

with the above changes i look at "BuyLimit2" trades and notice that some of the "BuyLimit" trades are now missing. I am lost why it is happening. I was expecting "if" to work the same way in both scenarios for BuyAtLimit entries.

in the example below there are no 9/23 and 9/24 "BuyLimit2" trades:

Position Symbol Quantity Entry Date Entry Price Exit Date Exit Price Profit % Profit $ Bars Held Profit per Bar Entry Name Exit Name MAE % MFE %
Long AA 370 9/25/2009 13.36 Open Open -2.1 ($103.60) 1 ($103.60) BuyLimit -2.69 0
Long AA 370 9/25/2009 13.36 Open Open -2.1 ($103.60) 1 ($103.60) BuyLimit2 -2.69 0
Long AA 353 9/24/2009 14.14 Open Open -7.5 ($374.18) 2 ($187.09) BuyLimit -8.06 0
Long AA 350 9/23/2009 14.26 Open Open -8.27 ($413.00) 3 ($137.67) BuyLimit -8.84 0.21

profile picture

deepbuyer

#2
QUOTE:
I seem to be having problems with this piece of code:
CODE:
Please log in to see this code.



I should correct myself that I don't think that the problem is with the above piece of code per se. This piece just detects the problem with the script as a whole. The problem is somehow related to the logic
CODE:
Please log in to see this code.
.
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).