Make it easy to trade WealthSignals (https://www.wealthsignals.com) systems using Wealth-Lab 7! We need a WealthSignals Trader to download signals like before and send them to now-connected brokers.
Rename
Sorry Robert, have to decline this request as duplicate 😂
https://www.wealth-lab.com/Discussion/WealthSignals-Trader-6558
https://www.wealth-lab.com/Discussion/WealthSignals-Trader-6558
I looked for it, but couldn't find it! Anyway, my offer to subscribe to DKJ stays on the table if there's a WealthSignals Trader tool to autotrade.
I'll personally enter your orders for you every day.
No, no. You don't get off that easily. I'll take the hit for everyone to promote a WealthSignals Trader tool!
.. although, I did just create a work-around for a WealthSignals customer. It's a pretty simple matter to create a text file from a WealthSignals email and read it from WL7 to generate the signals.
.. although, I did just create a work-around for a WealthSignals customer. It's a pretty simple matter to create a text file from a WealthSignals email and read it from WL7 to generate the signals.
Until this feature request is implemented, everyone can use the strategy below to automatically trade signals by exporting the WealthSignals signals email.
You’ll need to edit the strategyName and signalPath around line 37, and save the signals in a text file with the name strategyName_yyyyMMdd.txt, where yyyyMMdd is the signal date. The script will automatically look for the previous trading date, i.e., the signal date.
To create the text file, just select the signals from the WealthSignals email and paste it into a text file, and save it with the proper name_date.
Since WealthSignals only has Buy/Sell Market/Limit/Stop orders, this script should work for any strategy on WealthSignals.
Strategy Settings:
Single Symbol: Any valid symbol
Data Range - any
Position Size - any (will be set by the signal file)
Once you have the Signals in WL7, you can place them with the broker or send them to the Quotes Window for triggering and Auto Stage/Place.
You’ll need to edit the strategyName and signalPath around line 37, and save the signals in a text file with the name strategyName_yyyyMMdd.txt, where yyyyMMdd is the signal date. The script will automatically look for the previous trading date, i.e., the signal date.
To create the text file, just select the signals from the WealthSignals email and paste it into a text file, and save it with the proper name_date.
Since WealthSignals only has Buy/Sell Market/Limit/Stop orders, this script should work for any strategy on WealthSignals.
Strategy Settings:
Single Symbol: Any valid symbol
Data Range - any
Position Size - any (will be set by the signal file)
Once you have the Signals in WL7, you can place them with the broker or send them to the Quotes Window for triggering and Auto Stage/Place.
CODE:
using WealthLab.Backtest; using System; using WealthLab.Core; using System.Collections.Generic; using System.IO; using System.Linq; using System.Globalization; namespace WealthScript3 { public class MyStrategy : UserStrategyBase { string[] _sep = { "\t", "," }; string[] _sep2 = { " at " }; string[] _signals; public override void Initialize(BarHistory bars) { } //execute the strategy rules here, this is executed once for each bar in the backtest history public override void Execute(BarHistory bars, int idx) { //no op } public override void PostExecute(DateTime dt, List<BarHistory> participants) { if (participants.Count == 0) return; /* assumes you run this strategy on the morning of the trade date */ DateTime signalDate = DateTime.Now.Date.PreviousTradingDay(participants[0].Market); if (dt.Date != signalDate.Date) return; /* the filename must be Saltamontes_yyyyMMdd.txt, where yyyyMMdd is the signal date */ string strategyName = "AnyNameYouWant"; string signalPath = String.Format(@"C:\Data\Signals\{0}_{1:yyyyMMdd}.txt", strategyName, signalDate); WriteToDebugLog(signalPath); _signals = File.ReadAllLines(signalPath); string allsymstoday = string.Join(", ", participants.Select(x => x.Symbol)); WriteToDebugLog(dt.ToShortDateString() + "\tParticipants: \r\n" + allsymstoday); foreach (string signal in _signals) { double price = 0; string[] tokens = signal.Split(_sep, StringSplitOptions.None); if (tokens.Length < 1) // blank line continue; string saction = tokens[0].Trim().ToUpper(); if (saction == "ACTION") // title line continue; TransactionType ttype = TransactionType.Buy; switch (saction) { case "BUY": ttype = TransactionType.Buy; break; case "SELL": ttype = TransactionType.Sell; break; case "SHORT": ttype = TransactionType.Short; break; case "COVER": ttype = TransactionType.Cover; break; default: break; } if (tokens.Length < 4) { WriteToDebugLog("Signal error:\t" + signal); return; } string symbol = tokens[1].Trim().ToUpper(); BarHistory bh = GetHistory(participants[0], symbol); if (bh == null) { WriteToDebugLog("No BarHistory for: " + symbol); continue; } int shares = Int32.Parse(tokens[2].Trim()); OrderType otype = OrderType.Market; if (tokens[3].Trim().ToUpper() != "MARKET") { string[] typetokens = tokens[3].Split(_sep2, StringSplitOptions.None); otype = typetokens[0] == "Limit" ? OrderType.Limit : OrderType.Stop; price = Double.Parse(typetokens[1].Trim(),CultureInfo.InvariantCulture); } Transaction t = PlaceTrade(bh, ttype, otype, price); t.Quantity = shares; } } } }
Thanks for Matthias for catching some bugs!
The script above is now corrected for:
1. Previously, all signals were "Buy"
2. Globalization to properly interpret price decimal character.
The script above is now corrected for:
1. Previously, all signals were "Buy"
2. Globalization to properly interpret price decimal character.
If you used windows automate you could have it automatically export your email with specified subject line to write the text file on your computer.
How would you adjust the above code to have WL7 auto-update or periodically check to see if the text file was updated?
How would you adjust the above code to have WL7 auto-update or periodically check to see if the text file was updated?
QUOTE:
How would you adjust the above code to have WL7 auto-update or periodically check to see if the text file was updated?
Run it in Strategy Monitor?
If you exported the entire email, more filtering would may required (although the check for 4 tokens per signal line might already take care of that), and you'd probably have to modify the filename logic.
For the Strategy Monitor to work periodically, you'd have to run it on an intraday interval after market hours - so you'd need a forex or globex futures feed to trigger that.
And, since it only necessary to execute it on one symbol, there's no need/advantage to use the S. Monitor - just use a Strategy Window. You could actually fully automate order entry using Auto-Place, although since we're only talking about EOD signals, I think you should probably stay in the loop and make sure the orders are synchronized with your live account.
For the Strategy Monitor to work periodically, you'd have to run it on an intraday interval after market hours - so you'd need a forex or globex futures feed to trigger that.
And, since it only necessary to execute it on one symbol, there's no need/advantage to use the S. Monitor - just use a Strategy Window. You could actually fully automate order entry using Auto-Place, although since we're only talking about EOD signals, I think you should probably stay in the loop and make sure the orders are synchronized with your live account.
Thanks Robert, Is this for sending signals to Wealth-Signals, or just for receiving them? I would like to be able to quickly send my WL7 signals to my Wealth-Signals strategy like I could do from WL6.
Cheers,
Dub
Cheers,
Dub
"Trader" is meant for receiving signals.
WealthSigals Broker provider (legacy name: WS Publisher) is for submitting trades by WS authors:
https://www.wealth-lab.com/Discussion/WealthSignals-publishing-on-WL7-5510
WealthSigals Broker provider (legacy name: WS Publisher) is for submitting trades by WS authors:
https://www.wealth-lab.com/Discussion/WealthSignals-publishing-on-WL7-5510
WealthSignals Trader will be the core new feature for Build 19. As with WL6, we're adding it directly to the Tools menu for the most convienence. Still hoping to get Build 18 rolled out by the end of this week.
It looks like it's time to learn what WealthSignals is all about).
Are there any plans to add more US stocks to wealthsignals?
You can ask this question on the WS forum if you have a specific suggestion:
https://www.wealthsignals.com/Forum
https://www.wealthsignals.com/Forum
Is it possible to auto-place WealthSignals in WealthSignals Trader? I only find options to route signals manually.
Currently WealthSignals is end-of-day only. For market orders, you just place them before the open. For stop and limit orders, you can select them and "Send to Quotes Window" where you can monitor, trigger, and Auto-Place.
@Cone Thanks for the quick answer. But I need to clarify my question. I want to trade the WealthSignals without supervision, so that new signals are picked up and placed automatically overnight without my intervention. Similar to how the above script works, except that the signals are not read from the email file, but are fetched from wealthsignals.com.
We'll need a feature request to gauge how popular that facility would be. I guess it could be implemented with another command line switch.
Currently, you could start a Wealth-Lab Workspace with the WealthSignals Trader ready to go, but you need to press the buttons to login and place the orders. You could probably do that now with a little work in AutoIT.
Currently, you could start a Wealth-Lab Workspace with the WealthSignals Trader ready to go, but you need to press the buttons to login and place the orders. You could probably do that now with a little work in AutoIT.
I just posted a feature request for it:
https://www.wealth-lab.com/Discussion/Auto-Place-WealthSignals-7489
https://www.wealth-lab.com/Discussion/Auto-Place-WealthSignals-7489
Your Response
Post
Edit Post
Login is required