Import (real) historical trades: Buy failed
Author: mrBAV
Creation Date: 11/12/2019 6:06 PM
profile picture

mrBAV

#1
Hello.
I have got problems importing real trades.
Decided to test one trade per line txt file just with one trade inside, without trade size. Has found that in case if Exit or Enter price not in the range of bar-1 I’ve got an error in the Debug.
Testing was made on different bars and Tickers. Interesting that in case of the gap everything works nice. Testing was made with Format2 or SimTradeFile2. DateFormat and FileFormat haven’t been changed.
In setup and troubleshooting paragraph (Components - Import real trades) it comes that ‘’trade trying to enter above the high or below the low bar’’, but not bar-1?
profile picture

Eugene

#2
Hi Alexander,

It's pretty expected to get an error if entry and/or exit price falls out of the range. If you show an example of your code and attach a small sample data file, we'll try to explain what went wrong.
profile picture

mrBAV

#3
Hello Eugene,

But it falls out of the range bar -1. On the bar of the trade day the price inside of the range. In the example (price.bar.outside.bar-1) I put the price which was on 8/1/2019. But it wasn't there on 7/31/19 and got error.
profile picture

mrBAV

#4
txt file
profile picture

mrBAV

#5
WLD Provider gives such range for AAPL on 8/1/2019 O 214.02 H 218.03 L 206.7435 C 208.43.
And on 7/31/2019 O 216.35 H 221.37 L 211.3 C 213.04. For example I want to get my trade in WLD which was on 8/1/2019 with price 207.5. Do I need to change code in EnteratPrice Component?
profile picture

Eugene

#6
No need to change any code, it should work (and of course it does for me).

What may matter here is the rounding and slippage preferences. Please attach a screenshot of your "Slippage and Round Lots" settings (Wealth-Lab Preferences, F12 key).

And if AAPL is configured as a Futures symbol, then include relevant Symbol Info Manager settings, too. Thanks.
profile picture

mrBAV

#7
Eugene, thanks to you I understand where is my mistake. Will try without Slippage. Please see attached Preferences.
profile picture

Eugene

#8
Yes, too big a slippage for Limit orders. That's what I suspected. Glad you figured it out.
profile picture

mrsic

#9
Hi,
i am not a programmer but i give my best.

Maybe anyone can help me with this issue.
I am getting Entry and Exit error. See Attachment.
I guess something is mixed up.

Yahoo!Data - Perform Dividend Adjustment is disabled and testing on SSB.

CODE:
Please log in to see this code.

profile picture

Eugene

#10
Hi,

There's no error, it's working as designed:

1. Did AAPL trade on 1/1/2020? No, it was a holiday (New Year).
2. Is there a bar for 12/31/2020? No, because it's a date in the future.
profile picture

Cone

#11
If it's not clear, the dates in your historical trades file need to be corrected.
profile picture

mrsic

#12
Hi,

thanks. I have corrected the dates. It works, but I only get a trade if I enter the exact day with the exact Price. For example 16.01.2020 Buy 315. I thought i would enter a period of one year and he would show me the trades that reached "buy 315" during that period. This is not what i have looking for, i think, i need another way.
profile picture

Eugene

#13
Clearly you need some other way. The idea behind this solution is that your trade file is processed and if the combination of price/date from the file exactly matches the OHLC in WL, the trade is executed. That's why it's named "Import real (historical) trades" and not "Show possible trade opportunities during a given period", for example. But this discussion is subject for another topic if you wish.
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).