- ago
This is an outstanding tool included in WL7 - thank you

Any chance for ASCII parses to allow use of WL7 data and position sizing? it appears as if Quantity and Price fields have to be supplied with ASCII files against what's documented in help

Thanks again

Michael

5
1,153
Solved
30 Replies

Reply

Bookmark

Sort
Glitch8
 ( 10.94% )
- ago
#2
We can take that on as a #FeatureRequest. Apologies for the error in the help file.
0
- ago
#3
Marked as #FR.
0
Glitch8
 ( 10.94% )
- ago
#4
Looking for some more low-hanging-fruit in the Wish List so activated this for Build 11. Can work on it on the plane rides back home from Egypt :)
2
Best Answer
- ago
#5
A great enhancement to WL8 when ready - thank you Glitch
0
- ago
#6
Continuation.

I have a list of buys for certain tickers at certain dates but I don't have the prices and or the quantity.

How do I use the WL data prices and the position setter to be able to do run a backtest.

I would also like for system to only allow one entry into the stock (as you can see several buys on a few days) and things like that. If possible obviously.

THANK YOU!..


0
Cone8
 ( 24.99% )
- ago
#7
1. Prices are required for a Trade History Strategy.
2. I'm not aware of a Pos Sizer that limits Positions on a per-Symbol basis, but there could be one.
0
- ago
#8
QUOTE:
I would also like for system to only allow one entry into the stock (as you can see several buys on a few days) and things like that.

Strategy Settings > Position Sizing > set Max Open per Symbol = 1
1
- ago
#9
Would you maybe consider allowing for just tickers and dates and using WL data? I realize if tickers are not in database that may cause a problem but that is a relatively minor problem. Thank you for your consideration.

Best.
0
Cone8
 ( 24.99% )
- ago
#10
You can use any ticker you have data for. If you don't have the data, we're not considering it. No Data == No Backtest
0
- ago
#11
I don't understand -- With my WL9 subscription I have all sorts of data right?

Maybe not some delisted tickers, but other than that it is open season right?

0
Cone8
 ( 24.99% )
- ago
#12
I don't understand what you're asking for. What's the problem exactly?
0
- ago
#13
I don't either.

I have the dates and the tickers. If that data is available in one of my datasets I can run this historical backtest w/out needing to specifically have the prices in the file that I upload right?

Thank you for helping to clarify my confusion.
0
- ago
#14
If your trade history file doesn't contain the trade prices, it simply won't work.
0
- ago
#15
I think the poster simply wants to run a "standard" backtest on some WL dataset--nothing more. I don't think he's trying to analyze a "trade history" file from an earlier, real trading session; otherwise, he would have prices for each previous trade executed. He's confused between the difference of a "standard" backtest and analyzing a historical trace of a previous, real trading session.

Gbullr, you simply want to run backtest on a trading strategy with some symbols in a dataset, right? These symbols haven't been live traded in the past, right? ... so you haven't "recorded" the prices that these previous trades were placed.
0
- ago
#16
Yes. I figured it out. I would like to know how to just upload the buys and then play with different sell strategies.

Is it possible to just upload the buys?

Thank you.
0
Cone8
 ( 24.99% )
- ago
#17
Eliminating what you don't want to import from the file.
0
- ago
#18
Thank you.
0
- ago
#20
More help on history strategy please.

I import the trades. Starts w/ a cover by mistake this is just the screen capture. even if it starts w/ a short quantity or price is not tabulated.


WL produces no trades regardless of whether I use imported trade quantity or not
I have also set position size to 1 just to try.



I have tried importing quantity or not.

I have $SPY in WL (I can look at the chart)

How do I get WL to populate price and quantity based on position size ($5000). I have tried to no avail. Thank you.
0
Cone8
 ( 24.99% )
- ago
#21
You're loading trades that occurred at $0.
ELiminate the [$0] Price field if you don't have the actual trade prices.

Edit -
Strike that. The trade price is required. This a trade history strategy. The idea is to sync to trades that you've made.

If you just want to enter and exit by date at market, just make a strategy that reads the date file and add the logic to enter and exit when it hits one of those dates.
0
- ago
#22
How about reviewing posts #7 and #14?
0
- ago
#23
I had gotten WL to give me the data above, but I cannot repeat that functionality. I give the system a ticker and date and I would like it to tabulate trades based on price (CLOSE of that date) and quantity ($5000/CLOSE on that date)

I don't understand what changed from what I did the other day but I cannot get WL to populate.

0
Cone8
 ( 24.99% )
- ago
#24
Post some lines from your data file and we'll probably be able to help.
0
- ago
#25
Several suggestions:

Please consider the functionality that I am suggesting

Date / Ticker and WL autofills price and quantity based on Strategy Settings and OHLC data that WL contains in the datasets

I personally don't see the use of a backtester where the user is providing all the data. What do I need that backtester for in that instance? Maybe to consolidate the performance of several accounts, but considering one is not providing the cash balance etc I don't really know what it would be good for. There is no way you have all that data and you don't have the performance of the account. I may not be seeing the entire picture, granted.
0
- ago
#26


Here is the data file.

Ideally I want WL to fill in the price (trade on close date, trade on open next day (Strategy Settings allows for that)) for that date and calculate position size on those prices.

I understand what you are saying about generating the date logic in WL, I can do it by generating a date.txt and then importing that into WL... fine... I'll take a stab at that but if I have a strategy that I cannot replicate the logic on in WL but I can replicate on CSV because I have data that I cannot import (don't know how to import (openinsider)) into WL then it gets really complicated to run a backtest. It would be really easy if I provide ticker-date-BUY-SELL (short-cover) and then WL has the data to auto populate. I know you are not asking me, but that is pretty "homerunnish."

Somebody had written a script to do that in WL6.9.

Thanks.
0
Cone8
 ( 24.99% )
- ago
#27
This Strategy is specifically designed to analyze historical trades. It even says that in the name.

What you want to do is just a basic Strategy. It seems you want to Short (Market? AtClose? Limit?) on specific dates - presumably to backtest a periodic event that occurs on those dates. That's a strategy with rules, like any other.
0
Cone8
 ( 24.99% )
- ago
#28
This compiles, but you didn't give me a file of records to work with. If it doesn't work out of the box, you'll have to adapt it.

CODE:
using WealthLab.Backtest; using System; using WealthLab.Core; using WealthLab.Indicators; using System.Collections.Generic; using System.IO; namespace WealthScript4 { public class TradeDateStrategy : UserStrategyBase { public override void Initialize(BarHistory bars) {          DateTime dte = DateTime.MinValue;          string[] lines = File.ReadAllLines(@"C:\Data\MyTradeDates.txt");          foreach (string line in lines)          {             if (line.Contains("Action"))                continue;             string[] token = line.Split('\t');             if (token.Length < 2)                continue;             if (DateTime.TryParse(token[0], out dte))             {                // To trigger a trade on dte, the Date should be on the prior day                do                {                   dte.AddDays(-1);                }                while (!dte.IsATradingDay(bars));                if (token[1].ToUpper() == "SHORT")                   _shortDates.Add(dte);                else                   _coverDates.Add(dte);             }          }          } public override void Execute(BarHistory bars, int idx) { if (!HasOpenPosition(bars, PositionType.Short)) { if (_shortDates.Contains(bars.DateTimes[idx]))                PlaceTrade(bars, TransactionType.Short, OrderType.Market); } else {             if (_coverDates.Contains(bars.DateTimes[idx]))                ClosePosition(LastPosition, OrderType.Market);          } }       List<DateTime> _shortDates = new List<DateTime>();       List<DateTime> _coverDates = new List<DateTime>(); } }
0
- ago
#29
Thank you.

Please consider what I have suggested.

History strategy that imports dates and tickers and actions and WL provides the backets w/ trade on close, trade on open.

Thank you again.
0
- ago
#30
Since what you have suggested falls into single-user support category, our concierge support service may be optimail for your task: https://www.wealth-lab.com/Support/Concierge
0

Reply

Bookmark

Sort