- ago
Few questions :
1. Is it possible to get Capital , Amount and other settings in c# strategy class ?
2. Is it possible to set decimal fraction quantity : 0.2, 0.01 etc ?
0
552
Solved
4 Replies

Reply

Bookmark

Sort
- ago
#1
Sorry, your Monthly Plan has expired.
0
Cone8
 ( 6.32% )
- ago
#2
Still, fair questions -
1. Sure - see Backtester and BacktestSettings in the QuickRef

CODE:
public override void Initialize(BarHistory bars) {          WriteToDebugLog(CurrentEquity);          WriteToDebugLog(Backtester.PositionSize);          WriteToDebugLog(BacktestSettings.Commission);          }


2. PlaceTrade returns a Transaction object whose Quantity property is a double.
CODE:
public override void Execute(BarHistory bars, int idx) { if (idx == bars.Count - 1)         //alert only {                      Transaction t = PlaceTrade(bars, TransactionType.Buy, OrderType.Market);             t.Quantity = 1.25;          } }
0
Best Answer
- ago
#3
That works fine , thanks
CODE:
Transaction _trans = this.PlaceTrade(bars, TransactionType.Short, OrderType.Market); _trans.Quantity = 0.21;

How can I set number of visible decimals for Quantity column in Backtest results / Positions list (see screenshot)
0
- ago
#4
It should take the number of decimals specified for your market in Tools > Markets & Symbols.
0

Reply

Bookmark

Sort