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 ?
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 ?
Rename
Sorry, your Monthly Plan has expired.
Still, fair questions -
1. Sure - see Backtester and BacktestSettings in the QuickRef
2. PlaceTrade returns a Transaction object whose Quantity property is a double.
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; } }
That works fine , thanks
How can I set number of visible decimals for Quantity column in Backtest results / Positions list (see screenshot)
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)
It should take the number of decimals specified for your market in Tools > Markets & Symbols.
Your Response
Post
Edit Post
Login is required