- ago
Is it possible to cause an immediate Stop and/or Limit order placement with the equity order, so that there is not a minute delay with the placement of the Limit and/or Stop order. This delay causes a problem when the stops and limits are tight, as you can well imagine.
0
374
Solved
8 Replies

Reply

Bookmark

Sort
- ago
#1
There is no delay placing an order. The complete bar's OHLC is evaluated after it closes, and the limit/stop order can be executed intra-bar.
0
Best Answer
Glitch8
 ( 10.41% )
- ago
#2
Right, there is no delay. WL8 can place LIMIT and STOP orders that will get executed by the broker IMMEDIATELY when the price hits LIMIT/STOP price.
0
- ago
#3
So, what you are saying is that strategic market orders placed and accepted by say... Think or Swim, should be received by TOS along with the Limit AND Stop Orders, concurrently, without delay, right?

If so, I can tell you that in practice, having run strategies every day for the past 16 months, that my market orders are placed first, and then ... up to a minute later, the Stop orders and Limit orders are fed from WL8 to my TOS account where they sit opened as working orders until filled or closed, or ... rejected by the TOS system altogether because (for example) the market price is, by now, less than the Stop order price presented by the strategy and sent by WL8.

Is there a setting I may have selected that could be causing this?
0
Glitch8
 ( 10.41% )
- ago
#4
It sounds like you are missing the “same bar exit” capability in WL8. It’s a way to have stop and/or limit orders placed immediately after the entry signal fills.

it's explained in this video:

https://www.youtube.com/watch?v=DtU-sDJNnfI
0
- ago
#5
The video (1 yr ago) says it's only for C# coded strategies, which I do not run.

1) Has this function been provided in WL8 for block strategies?
2) If not, can I have that "same bar exit" strategy you showed on your YouTube, so I can cut my teeth on this ?
3) Is it possible to have this functionality for block strategies, in WL8?

Thx
0
Glitch8
 ( 10.41% )
- ago
#6
1) No
2) I don't have that one specifically, but coded a minimal example below
3) It could be submitted as a #FeatureRequest

CODE:
using WealthLab.Backtest; using System; using WealthLab.Core; using WealthLab.Data; using WealthLab.Indicators; using System.Collections.Generic; namespace WealthScript3 { public class MyStrategy : UserStrategyBase { //create indicators and other objects here, this is executed prior to the main trading loop public override void Initialize(BarHistory bars) {          rsi20 = RSI.Series(bars.Close, 20);          PlotIndicator(rsi20); } //execute the strategy rules here, this is executed once for each bar in the backtest history public override void Execute(BarHistory bars, int idx) { if (!HasOpenPosition(bars, PositionType.Long)) {             //code your buy conditions here             if (rsi20[idx] < 35)                PlaceTrade(bars, TransactionType.Buy, OrderType.Market); } else {             //code your sell conditions here             PlaceTrade(bars, TransactionType.Sell, OrderType.Limit, limitExit);             PlaceTrade(bars, TransactionType.Sell, OrderType.Stop, stopExit); } } //implement same bar exits based on execution (fill) price public override void AssignAutoStopTargetPrices(Transaction t, double basisPrice, double executionPrice) {          //5% limit exit          limitExit = executionPrice * 1.05;          //10% stop exit          stopExit = executionPrice * 0.9;          t.AutoProfitTargetPrice = limitExit;          t.AutoStopLossPrice = stopExit; } //declare private variables below private RSI rsi20;       private double limitExit;       private double stopExit; } }
0
- ago
#7
Thanks Glitch. Looks like Cone already filed a #Feature Request for this Feb 21.


Finally, on a side-by-side basis, is a C# coded strat faster or more profitable that a block strat, all other things being equal?
0
Glitch8
 ( 10.41% )
- ago
#8
No, a Block strategy is converted to a Code Based strategy behind the scenes anyway.
0

Reply

Bookmark

Sort