- ago
Stop orders



I have designed a system that goes into the market by stop.
Now I have the following problems:
The signal is displayed and I place the order on the exchange. Every day there are new signals. The number of positions are limited by my capital. A position is created when the stop is triggered. However, my capital is already tied up when I enter the order. Thus, at 10% per position, I could only place 10 stop orders. WL assumes that all stops remain active until they are filled or changed. With 30 instruments, this could theoretically be 30 stops. This does not correspond to the real situation on the stock exchange.
I can think of only 2 solutions, but they do not make sense:
1. limit the number of instruments to 10, e.g. at 10% per position. So little choice makes practically no sense
2. reduce the position size so that all stops can be active. With 30 instruments, that would be 3%. But this way my capital is not well utilized and the return becomes unacceptable.

Another problem for me is that I have no overview of the current stops in WL. A stop signal from yesterday is still active today, but is no longer displayed as a signal.

Maybe there is a simple solution I see.

1
985
54 Replies

Reply

Bookmark

Sort
Cone8
 ( 26.65% )
- ago
#1
In terms of a Daily+ scale backtest, see "Use Granular Stop/Limit Processing" in Strategy Settings > Advanced Settings. With intraday data, you can determine which stops were actually entered.

In terms of live trading:
1. In Trading Preferences set the Trading Threshold entry counter to 10 (or whatever the limit will be that day) and check "Cancel all open Entry Orders...

Actually, in this case a cash or buying power Threshold would be more automatic and you wouldn't have to check the preference everyday. So many options!

2. Use Portfolio Sync Trading options. In any case, if your strategy signals an exit for a position that your don't hold in your account, the order will Error and won't be placed. Although, you should be able to control the exit orders your place for a Daily strategy.
0
- ago
#2
Maybe one idea would be to extend the "Number of Open Positions" function to "Number of Open Stops" to be able to limit the number of open stops.
0
Glitch8
 ( 8.38% )
- ago
#3
These are entry stops? You need to use the Quotes tool to monitor all the prices and it will place the orders only when they get close to the target price.
0
- ago
#4
At the moment I still do everything manually. I had the idea that I simply place the signal from WL as stop orders and then wait. I guess that's not how it works?

I also trade different systems in parallel on different exchanges, stocks and cryptos.
I would need the account and strategy related.
All in one list is very confusing
0
Glitch8
 ( 8.38% )
- ago
#5
Did you try using the Quotes tool?
0
Cone8
 ( 26.65% )
- ago
#6
When you generate the Signals with the Strategy Window,
1. configure the broker
2. select all the signals
3. Send them to a Quotes and Triggers window.

Repeat for other strategies and brokers.



Now in the Quotes Window, configure if you you want to trigger the order when the stop is hit (Threshold = 100) or a little before it gets to the stop price (Threshold < 100) so that it's waiting live at the broker. Select either Auto-Stage or Auto-Place. If Auto-Stage, then you have to click to Place the order from the Order Manager.
0
- ago
#7
Thank you for the information.
The problem is that the strategy is cryptos.
The exchange, in this case Coinbase, does not connect to WL.
Unfortunately, the interface to Binance does not work reliably either.
I don't have a reliable data stream, only EOD. At Cryptocompare I have indeed booked the stream. WL can process because at the moment but not yet.
0
- ago
#8
WL8
I now have it on Kraken to connect to trading. It also seems to work. All fields are green.
What I don't see is that WL adjusts the position size to the real account. Where in WL do I see the account balance that is sent from the exchange. I can't find any way to check if the account balance is processed correctly.
0
Glitch8
 ( 8.38% )
- ago
#9
You can see it in the Tools, Accounts window.
0
Cone8
 ( 26.65% )
- ago
#10
QUOTE:
don't see is that WL adjusts the position size to the real account.
Signals are adjusted for % of equity position sizing and only if you've selected that Portfolio Sync Trading Preference.
0
- ago
#11
In the account window I can see the correct account balance and also the positions.
The order manager does not show the % value from the account, but from the trading system.
If I move an order from "Quotes" to the order manager, the much too high value is only rounded and not converted to the actual real account size.
I have made the following settings in ProfolioSync
0
Cone8
 ( 26.65% )
- ago
#12
In the Signals pane, you need to select the Broker/Account before sending the signals to Quotes. Sizing is adjusted when you select the account.

0
- ago
#13
I know, but it just doesn't work.
WL restarted, did not help either.
0
Glitch8
 ( 8.38% )
- ago
#14
Here's a video of it in action, make sure you are doing the steps shown here ...

https://drive.google.com/file/d/1Wn5cLV2XvRYU2pQz3opsPaqsTRHr6iJ-/view?usp=sharing
0
- ago
#15
This works only for dummy accounts. Neither with Binance nor with Kraken, although the account balances are displayed correctly in the account tool, they are not taken into account for the calculation of the position size.
0
Glitch8
 ( 8.38% )
- ago
#16
Hey Lukas, it's working for Binance, here's a video, but Kraken is a problem. We aren't getting an Account Value proper from the Kraken API. So, this feature currently won't work with Kraken. Let us see what we can do about Kraken here.

https://drive.google.com/file/d/1f5KYg6u2wrdu2Dy_j6KE-ErkKtE-iJi9/view?usp=sharing
0
Glitch8
 ( 8.38% )
- ago
#17
Goods news, we're able to add Balances to the Kraken extension for our next release.
0
- ago
#18
I tried around some more.
Binance is now adjusting the calculation of the shares.
However, you have to restart the backtest to do this. If you change the to the dummy accounts, it is also adjusted without a new backtest.
But the calculation of the shares does not fit and is not understandable for me.
With shares one always exchanges $or€ against shares and back.
With cryptos, this is not necessarily the case.
How does WL deal with this?
For example, if I have BTC as the base currency. So I exchange BTC for other coins and back.
Does WL recognize this based on the trading pair, e.g. ETH/BTC?

0
Cone8
 ( 26.65% )
- ago
#19
QUOTE:
Does WL recognize this based on the trading pair, e.g. ETH/BTC?
No.

Wealth-Lab is [currently] NOT multi-currency. There is only one base currency - whichever one you're testing - and this is assumed to be the same for all the instruments you're testing, your account value, etc.

We need forex and crypto traders to vote for this feature request - in more than a year it only has 3 votes. Vote!
https://www.wealth-lab.com/Discussion/Cross-Multi-Currency-Simulations-5984
0
- ago
#20
Now I am trying to use "Quotes" to order via Binance. Since WL can't calculate the number because the account currency is BTC, I calculate the number in an Excel spreadsheet and transfer the values manually.
Now there is the following problem:
I cannot correct value below 1. For stocks this is certainly correct, but not for cryptos.
0
Glitch8
 ( 8.38% )
- ago
#22
Confirmed that you cannot edit a signal quantity and assign a value less than 1, fixed for Build 7.
0
- ago
#23
Now the order routing works via Kraken.
I send the signals as recommended above to the "Quotes".
Then "Quotes" opens and the signals are to sin. The broker has been taken over. Still have to select the stream manually unfortunately.
I choose "Auto-Place" and expect the signal to become an order when "Thershold" has been exceeded. Since no stop has been triggered at the moment, I have not been able to observe this yet.

Quotes" window
I have "Auto-Sort" enabled.
>What is sorted here? It looks like it is sorted by trigger%.
>What is Trigger%. That can also take negative values. What does it mean? How is it calculated?

From Kraken the current prices are shown only for 20 symbols, although I have more signals.
>Is this a limitation of WL or Kraken?
>Are the signals for which no rate is displayed still monitored, just not displayed, are these signals not evaluated?

When I restart the PC or even just WL, the Quotes window and all the values in it are gone. Is this the right way to do it?

Ordermanager:
Here the window is still selectable, but all orders, even those already transmitted to the exchange have disappeared.
>Also here the question, is this an error or is there a reason for it? I actually assume that if I restart WL, I can continue to work in the same place. How am I supposed to monitor the orders this way?

0
Glitch8
 ( 8.38% )
- ago
#24
>>What is sorted here? It looks like it is sorted by trigger%.<<

Yes it is trigger percent.

>>What is Trigger%. That can also take negative values. What does it mean? How is it calculated?<<

It is how far the price has moved so far toward the trigger price. If the price has moved in the opposite direction, it'll be negative.

>>From Kraken the current prices are shown only for 20 symbols, although I have more signals. Is this a limitation of WL or Kraken?<<

That I'm not sure of, can you paste the list of symbols so we can troubleshoot?

>>Are the signals for which no rate is displayed still monitored, just not displayed, are these signals not evaluated?<<

If a symbol isn't displayed in the Quote tool, it's not being monitored.

>>When I restart the PC or even just WL, the Quotes window and all the values in it are gone. Is this the right way to do it?<<

If you save a Workspace then the symbols and quotes will get re-populated as they were when you open the Workspace again.

>>Ordermanager: Here the window is still selectable, but all orders, even those already transmitted to the exchange have disappeared.
>Also here the question, is this an error or is there a reason for it?<<

There are a few check boxed to control whether completed or canceled orders are automatically removed. If none of those are checked off, then no the orders should not disappear. If you're seeing this happen then we'll take a look.

>>I actually assume that if I restart WL, I can continue to work in the same place. How am I supposed to monitor the orders this way?<<

Create a Workspace and load it again when you restart WL. But it's sometimes difficult to get everything 100% back in sync with the broker, so we recommend keeping it running during a trading session if possible.
0
- ago
#25
Hello,
Thanks for the answer.

Quote:
not all courses from the Kraken are displayed here.
The trigger values are not shown either.
But since there is a sorting by trigger, it may be that the values are there, just not in the display.
What does the "Trigger" button mean?
Do I have to mark all orders that I want to transfer automatically at e.g. 95% and then press the trigger button? Or are they all automatically active for the transfer?

Order Manager:
I entered orders today and submitted them to Binance. After a restart, they are no longer there.

Transfer of orders from Quote to Ordermanager:
After a restart, the order manager always selected the top broker in the list. It does not remember the last status.
How does the transfer from Quote to Order Manager work?
I work in parallel with different brokers. Can WL handle this?
What happens if Quote wants to transfer an order via Auto-Place? Can this be done via the order manager or directly?
Is this possible if another broker is currently set in the order manager?


0
- ago
#26
0
- ago
#27
update new day:
I restarted WL and started the stream from Kraken.
No data appears for some symbols. In general, there is no update. Something is not working properly.
0
Cone8
 ( 26.65% )
- ago
#28
The problem is that you're not using Kraken symbology.

Two Checks for you -
1. Look the Kraken Symbols Dataset - this DataSet comes straight from Kraken and contains the symbols you should use for Kraken.

2. Look at what are probably many messages in Tools > Log Viewer like this one -

Kraken
Kraken Subscribe Error: (XLM.EUR): One or more errors occurred. (XLM.EUR is not a valid Kraken websocket symbol. Should be [BaseAsset]/[QuoteAsset] in ISO 4217-A3 standardized names, e.g. ETH/XBTWebsocket names for pairs are returned in the GetSymbols method in the WebsocketName property.)


On to the list of questions...

QUOTE:
What does the "Trigger" button mean?
Trigger % is a measure of how close price is approaching the stop/limit price from the last close*. So, if price closed at $10.00 for the previous session, and you have a buy at limit order for $9.00, Trigger % will be 50% when price is at $9.50 and 100% at $9.00. When the predetermine Trigger % is reached, the order is "triggered" and will be Auto-Stage or Auto-Placed if one of those options is selected.

* If you enter Quotes/Triggers during market hours, the Trigger % basis is the first tick instead of the previous close.

QUOTE:
Do I have to mark all orders that I want to transfer automatically at e.g. 95% and then press the trigger button? Or are they all automatically active for the transfer?
Use Auto-Stage or Auto-Place

QUOTE:
I entered orders today and submitted them to Binance. After a restart, they are no longer there.
By design. For most brokers we'll try to load active orders, but I'm not sure if Binance is one of them.

QUOTE:
Transfer of orders from Quote to Ordermanager:
After a restart, the order manager always selected the top broker in the list. It does not remember the last status.
The Order Manager retains the last selected broker, which is the one used for Manual Order entry and has nothing to do with orders staged/placed for other brokers.

QUOTE:
How does the transfer from Quote to Order Manager work?
See Help Guide for Stage/Place, Auto-Stage/Place in the description for each tool that uses them.

QUOTE:
I work in parallel with different brokers. Can WL handle this?
Yes, a new Order block will appear for each broker / trading system.

QUOTE:
What happens if Quote wants to transfer an order via Auto-Place? Can this be done via the order manager or directly?
If a signal is triggered with Auto-Place enabled, the signal becomes a live order in the Order Manager.

QUOTE:
Is this possible if another broker is currently set in the order manager?
Of course and already answered - the one "set" in the Order Manager is used for [new] MANUAL orders.
0
- ago
#29


update:
The symbols fit. Gradually, the data odds of Kraken are also loaded.
It sometimes takes hours.

Why are the triggers not calculated?
Is it because WL waits until current prices for all symbols are available?

Now only WBTC.EUR is missing. Yesterday I already had a price there. The timestamp is from yesterday 10:36. Why was the timestamp saved and not the price?
0
Cone8
 ( 26.65% )
- ago
#30
I guess you're using Symbol Mappings for Kraken Streaming, that's why it's able to return data for symbols with a period between a currency pair. However, I'm noticing that with Symbol Mappings you don't get the price decimals required, so that's something we need to do better.

QUOTE:
It sometimes takes hours.
Quotes are only updated when a quote arrives from the provider.

QUOTE:
Why are the triggers not calculated?
Not sure - maybe because it's "outside of market hours". Which Market is selected at the bottom of the Quotes window? And is Filter Pre/Post Market checked? If you just screenshot the whole tool, we wouldn't have to ask for more info.

QUOTE:
Now only WBTC.EUR is missing. Yesterday I already had a price there. The timestamp is from yesterday 10:36. Why was the timestamp saved and not the price?
Nothing is "saved". 10:36 is just time when you entered the symbol in the quotes tool, otherwise it will update with the time of the last quote.
0
- ago
#31
QUOTE:
QUOTE:
Why are the triggers not calculated?
Not sure - maybe because it's "outside of market hours". Which Market is selected at the bottom of the Quotes window? And is Filter Pre/Post Market checked? If you just screenshot the whole tool, we wouldn't have to ask for more info.



0
Cone8
 ( 26.65% )
- ago
#32
Then the Market wasn't it.
Do me a favor and post your Kraken Streaming Symbol Mapping from the Data Manager so I can duplicate your conditions.

There are things I don't understand, like how you're getting a Kraken quote for LTC.EUR or ETC.EUR. Neither are valid Kraken symbols that would return data in the websocket.
0
- ago
#34
Now all symbols have a course.
Perhaps it is also because, as with a stock exchange, a new price is only delivered when there is turnover.
But this does not explain why WL does not calculate a trigger.

0
Cone8
 ( 26.65% )
- ago
#35
Interesting.

Let's put this on hold for Build 7. Although I can't duplicate that "non trigger %", we've made some changes for the Quotes window that deal with symbol mappings, and, the Timestamp won't be initialized to the local time when first entering a quote/trigger. Currently it's initialized with a local time and then updated with the UTC timestamp of the Kraken quote.

Let's wait for Build 7 and the next Kraken Provider update before continuing here.
0
- ago
#36
I think there are two ways of reading the symbols of Kraken.
When I map to e.g. XLMEUR, I get a message that this is not a websocket icon. It is requested XLM/EUR.
If I place an order in the order manager, it will not be executed, with the message that XLMEUR is required.
Can I run two mapping procedures at the same time.
XLM.EUR-->XLM/EUR and XLM.EUR-->XLMEUR?
0
Cone8
 ( 26.65% )
- ago
#37
Kraken provides the list of tradable symbols when you connect. None use the "/" separator. Further, some symbols like XRPEUR AND XLMEUR need to be specified using the extra X (crypto) and Z (currency) symbols... e.g., XXLMZEUR.

I think (I'll check) that the reason you can use the "/" is because we switched to a Nuget component for the WL8 version of the Kraken Provider. It would be doing the symbol transcription, removing the / and sending it to Kraken.

I'll try to get a handle on this, but it would be better if you removed the "." or "/" from Kraken symbols. Then there won't be a problem trading them.
0
Cone8
 ( 26.65% )
- ago
#38
Here's the handle on Kraken -

You must use (or map to) "Kraken Symbols" for Kraken for data, quotes, and trading. Kraken Symbols are loaded upon connection with Kraken and do not have separators like "." and "/".



When you use these symbols, all the quote and decimal properties will be known, and you can trade. Notice the decimal precision appears when using Kraken Symbols -


If you enter (or apply by mapping) a "/" separator for Kraken Streaming, it turns out that the result matches an internal "Websocket Symbol". So data are returned, but again, you won't get the precision and cannot trade it - because it's not a Kraken Symbol.

If you want to use Kraken as a streaming provider for other symbology that uses separators, Kraken Streaming Symbol Mapping should remove separators like this: [[\.\/]=]

If you do that, you will also be able to trade these symbols.
0
- ago
#39
My signals are generated daily from data from Cryptocompare.
I map the data from ETH.EUR to ETHEUR as follows to be able to monitor the stops in "Quotes".
There not all symbols are streamed and I get error messages.

Streaming works perfectly for Binance.



0
- ago
#40
0
Cone8
 ( 26.65% )
- ago
#41
I see. Somewhere in the process following the mapping the symbol format is not correct.

Do me a favor, and follow this procedure to verify quotes:
1. Open a Quotes window
2. Select Kraken > Stream
3. From the Kraken Symbols DataSet, drag in a few, active symbols.

You may have to wait several seconds for a trade to occur for each symbol, but it works, right?
0
- ago
#42
I have tried that. I noticed that Kraken has a different spelling for the symbols that did not work. I have changed the mapping for these symbols. To make the mapping work I had to restart WL. After that the error message was gone in Quote. But still not all prices were loaded.
After I created a new quote, error messages were there again, even for pairs for which prices were now loaded.
I also don't understand why the prices come in so slowly in Kraken. In Binance the list fills up immediately. With Kraken it can take hours


CODE:
[[\.\/\-]=] XRP.EUR=XXRPZEUR ETH.EUR=XETHZEUR BTC.EUR=XBTCZEUR LTC.EUR=XLTCZEUR DOGE.EUR=XDOGEZEUR ETC.EUR=XETCZEUR XLM.EUR=XXLMZEUR XMR.EUR=XXMRZEUR





0
- ago
#43
Perhaps it is an indication that the prices have only 2 digits after the decimal point. With you, Cone, it was, e.g., with ADA 6 digits

0
Glitch8
 ( 8.38% )
- ago
#44
Lukas, do you have Kraken enabled as a Historical Data Provider in your Data Manager? If you don't, currently you won't get the correct decimals in the Quotes tool. I've improved this for Build 7 to even if you just have Kraken selected as Streaming, it will first attempt to get the decimals from Kraken historical, even if it's not enabled in the Data Manager as a Historical Provider. Build 7 target release is Thursday.
0
Cone8
 ( 26.65% )
- ago
#45
QUOTE:
I also don't understand why the prices come in so slowly in Kraken. In Binance the list fills up immediately.
I haven't really been paying much attention to crypto lately, so I'm no expert. But Kraken is a different exchange than Binance (which for all I know could be a group of exchanges), so it's just a matter of how quickly a trade occurs on the exchange you're using.
0
Glitch8
 ( 8.38% )
- ago
#46
Yep, in fact, we use the same underlying library, CryptoExchange.NET, for both of the providers.
0
- ago
#47
QUOTE:
Lukas, do you have Kraken enabled as a Historical Data Provider in your Data Manager? If you don't, currently you won't get the correct decimals in the Quotes tool. I've improved this for Build 7 to even if you just have Kraken selected as Streaming, it will first attempt to get the decimals from Kraken historical, even if it's not enabled in the Data Manager as a Historical Provider. Build 7 target release is Thursday.


Hi Glitch,
I generally take the historical data from Cryptocompare. I don't trust the historical data from the exchanges. For some symbols that you can trade, historical data is not provided by the exchanges. I prefer the consolidated data from CC. Putting the streamer's prices in front in Quote is a good idea. Thank you!
0
- ago
#48
QUOTE:
QUOTE:
I also don't understand why the prices come in so slowly in Kraken. In Binance the list fills up immediately.
I haven't really been paying much attention to crypto lately, so I'm no expert. But Kraken is a different exchange than Binance (which for all I know could be a group of exchanges), so it's just a matter of how quickly a trade occurs on the exchange you're using.


Hi Cone, Kraken is certainly a slightly smaller exchange than Binance, but I don't believe that there is no trading for hours in a liquid market.
0
Glitch8
 ( 8.38% )
- ago
#49
Make sure your Market is set to Cryptos and not US Stocks in the status bar. In Build 7 Kraken will set this by default when selected.
0
- ago
#50
update:
Also over night the price list in quote has not filled completely, although at Kraken in the chart movement were to be seen at the not filled symbols.
Also the error message "websocket..." was still there.
I hope that WL-update tomorrow brings a solution.
0
- ago
#51
last quote-window Kraken

0
- ago
#52
update:
WL8B7 Quote
In build 7, prices now display decimal places.
Not yet for the quantity <1.
The list is filled only very slowly, or partly not at all, although at Kraken is traded and new prices arise.
The error message "websocket..." is also still there






0
- ago
#53
0
Cone8
 ( 26.65% )
- ago
#54
A couple of those symbols aren't Kraken symbols, but I think I'd agree that it doesn't feel like we're getting the responsiveness that we should. Over the next days, I'll compare it to our WL7 Kraken provider, which I don't remember having these kinds of issues.
0

Reply

Bookmark

Sort