- ago
ok, getting a strange series of errors that I suspect tie back to markets & symbols setup. But, need some assistance and direction to solve.

I am getting order rejections that I think tie to BPV and the increments that a specific symbol can be traded at with a limit order.

Here is the screenshot of both the log and and order manager inside of tradestation.

0
113
4 Replies

Reply

Bookmark

Sort
Cone8
 ( 7.89% )
- ago
#1
Thanks. We'll look into that.

To work around it right away, you can massage limit and stop prices in your script like this:
CODE:
public override void Execute(BarHistory bars, int idx) {          if (idx == bars.Count - 1)      // last bar          {             // your limit (or stop) price             double limit = bars.Close[idx] * 0.995;                          // round it to the tick size             double tick = bars.SymbolInfo.TickSize;             double newlimit = Math.Round(limit / tick) * tick;                          WriteToDebugLog($"tick: {tick}; limit was: {limit:N4}; is: {newlimit:N4}");                          Transaction t = PlaceTrade(bars, TransactionType.Buy, OrderType.Limit, newlimit);          } }
Technically, depending on the TransactionType and OrderType, you would use "Floor" or "Ceiling" instead of Round, but this is the quick and dirty solution.
0
- ago
#2
thoughts on a workaround for a block strategy?
0
Cone8
 ( 7.89% )
- ago
#3
You'd have to export it to C# Code (button at the top), edit it, and use that one.

We'll get it resolved in the next TS update.
0
- ago
#4
awesome, set my expectations on timing if you can?

Lots for me to do, but I am a planner :)
0

Reply

Bookmark

Sort