- ago
Hello,
I've been using this strategy to buy a down gap, and sell when it fills the gap:



It works fine, and the OM looks like this:



Even though you can't see the sell orders in the OM , they work fine, placing the sell orders whenever one of the buy orders actually occur.

So, now I wanted to try placing orders that, once bought, would sell at a 1% profit instead of waiting for the gap to fill all the way up to the previous day's close. I thought this would work:



However, unlike the previous strategy, it throws out the sell orders immediately which does not seem like it would work.



I've cancelled all the orders (296) as I don't want to risk needing to place 296 sell orders by hand if it (most likely) doesn't work.

Any idea as to why the Sell at 1% strategy does not seem to function as the other one does?

Thanks!
0
190
13 Replies

Reply

Bookmark

Sort
- ago
#1
btw, click "Need to load data". Your backtest does not include the last bar.
0
- ago
#2
Thanks.
I'm not using it to backtest; I use it to place the trades.
I run it the night before. The limit orders do use 1% below Friday's close.
0
- ago
#3
You've activated "Same-Bar" sell orders.
0
- ago
#4
Yes. I want to buy and sell in the same day. Buy if a stock opened 1% or more below the previous day's close. Then sell as soon as it rises 1%. Both the original strategy and this new one are same day buy & sells.
0
- ago
#5
Same-Bar exit blocks place stop and/or limit exit orders immediately after your Limit entry order is filled. I assume you've activated "Use Live Positions" in Preferences > Trading?
0
Cone8
 ( 23.97% )
- ago
#6
You have multiple positions selected. The sells are the hypothetical exit orders for the trades that were entered last session but did not exit on the same bar. Since you don’t own the positions they error out.

With Single position, you’d only see the sell exit orders for those stocks.

I'll also add that you can expect to get sell orders for hypothetical trades that the backtest cannot confirm would have exited on the same bar - even if they were filled in live trading. Generally, WealthLab fills same-bar limit exits in a backtest only if the Close of the bar is beyond the limit price. (Other special cases apply.)
0
- ago
#7
I never checked Use Live Positions.
The strategy using Sell at Limit 0% below Close has been working to actually place buy orders at the open, and then automatically place the appropriate sell order. Here is it working today:



I don't know why the strategy with Sell at 1% profit target should work any differently. How are they different when applied to live trading? I'm not doing any backtesting with these, only live trading.
0
Cone8
 ( 23.97% )
- ago
#8
Live Positions only can make a difference in the Strategy Monitor and Streaming Chart.

While the Strategies are not precisely the same, they should be close. I agree. I think there's a bug in assigning the Same-bar stop for the "Sell at Limit 0% below Close" block. We'll investigate and fix.
0
Cone8
 ( 23.97% )
- ago
#9
I see the problem. The series index used for the same-bar stop price is wrong - it's being assigned to the current index instead of the index of the previous bar.

Also, the strategy isn't really the same at all. In the first case, the price for "Sell at 0% below Close" will change with Close for every bar. In the "Profit Target" case, the exit price is fixed at 1% above entry price - that trade may never exit.
0
- ago
#10
So it sounds like the Profit Target one should not be usable in live trading. Am I understanding that correctly?

Hopefully, any fix does not stop my first strategy from placing the sell orders. That is my main reason for using WL (so far).
0
Cone8
 ( 23.97% )
- ago
#11
The Profit Target logic is correct and works for backtests and live same-bar trading. The problem with the strategy above that uses only the Profit Target exit is that a Position may never hit the profit target, or, it may hit it years later. You should add another way to get out of that trade - Sell after N days, or a Stop Loss.

That's different than the other strategy 0% at Close because this target is always moving. You only need the price to cross the previous close to get out of the position.

The BIG problem with that (and other same-bar logic blocks) is that they're using data from the current bar in backtests. Until we get that fixed, those backtests are invalid.

Review:
- the Profit Target block (with or without Same-Bar stop) is CORRECT.
- the Sell at Limit % block is correct only if Same-Bar stop is DISABLED.
0
- ago
#12
In the Review you are referring to backtesting only, right? I'm only doing live trading, not backtesting.
Because "Sell at Limit 0% below Close" is working just fine for my live trading needs, but only with Same-Bar enabled:

The first strategy (above) places the buy at the open.
If the stock gaps down properly, and gets bought, then it sends out the sell order.
If the stock trades up to the previous day's close, the sell order kicks in.
If it doesn't, then I manually change the remaining sell orders to MOC via TOS, near the end of trading.

I hope any fix doesn't stop this from working.
Thanks!
0
Cone8
 ( 23.97% )
- ago
#13
You're probably right. The block error "peeks" at today's current Close for the same-bar exits in a backtest. That's also why you're not seeing any exits for positions you entered but didn't exit on the same-bar. The backtest always fills those same-bar exits (even when it shouldn't) so it's not generating the limit target for today.

I haven't checked myself, but there's no way it can do that for live trading, so the only data available is the previous day's bar.
0

Reply

Bookmark

Sort