- ago
when FutureMode is enabled, the strategy in limit orders sets OrderPrice = -21 474.84 despite the specified price in the code
0
750
Solved
11 Replies

Reply

Bookmark

Sort
- ago
#1
Can you share the strategy code and backtest settings to reproduce what you may be seeing? To clarify explanations, send a screen shot by striking the "Print Screen" key and then pasting into Paint or other imaging application. Save as PNG and attach.
0
- ago
#2
It looks like a fraction of the minimum value and Int32 can take i.e. -2,147,483,648.
0
- ago
#3
QUOTE:
It looks like a fraction of the minimum value and Int32 can take i.e. -2,147,483,648.


CODE:
using WealthLab.Backtest; using System; using WealthLab.Core; using WealthLab.Indicators; using System.Collections.Generic; namespace WealthScript2 { public class MyStrategy : UserStrategyBase { public override void Initialize(BarHistory bars) { } public override void Execute(BarHistory bars, int idx) { if (!HasOpenPosition(bars, PositionType.Long)) {             var t = PlaceTrade(bars, TransactionType.Buy, OrderType.Limit, bars.Close[idx] +10, "sample");             WriteToDebugLog(t.OrderPrice);          } } } }

result:

settings:

symbol

debug:

0
- ago
#4
Thanks. Hmm I made SPY part of the Moscow Stock Exchange market, defined it as Futures, turned on Futures mode etc., ran your code on SPY and still cannot reproduce. There must be something else to it we're overlooking.
0
- ago
#5
By the way I notice your regional settings are Russian (comma is the delimiter). Tried this now and still no luck.
0
- ago
#6
1. What's your position size?
2. Anything unusual on the chart of BTCUSD? (what data provider is this? you can find it out in the chart's status bar)
0
- ago
#7
i've checked other dataset and cant reproduce issue. So additional settings attached


0
- ago
#8
Looks odd, we released B3 of Russia a week ago. How could the current build be "2" on your screenshot?? Unless you really saved that error report before May 13.

The debug log does not correspond with your sample code: it should produce exactly one line (and not 9+ as on your yesterday's screenshot):

---Symbol by Symbol Debug Logs---
---BTCUSD---
55706,83

Anyway, I cannot reproduce this with your settings using Finam's data.
0
- ago
#9
1. Just didn't restart for 5 days
2. The transaction does not occur due to the negative price, therefore, message repeated at every bar

0
- ago
#10
Try to set your tick size to a reasonable positive number, currently you have a clearly bogus (negative) value there:

0
Best Answer
- ago
#11
Thanks - really helped. Earned.
0

Reply

Bookmark

Sort