The new ability to add Indicators to Position Metrics is a great feature. However, it is a bit let down by the inability to specify the complete set of actual parameters to configure the indicator correctly. The single global period is fine as a version 1 placeholder, and it helps in some limited cases, but I'm hoping that we will be able to configure and save the parameters for each indicator properly (maybe trigger the same dialog as when adding to chart when you add it to the Selected Position Metrics list). Then this will be a truly powerful addition. Thanks!
Rename
True, there's room from improvement there. But don't let that stop you. You can add any position metrics you like using the SetPositionMetric method of the Transaction class. You get a Transaction instance when your code calls PlaceTrade. Here's some example code...
--private variables--
private RSI rsi4;
private RSI rsi8;
--in Initialize--
rsi4 = RSI.Series(bars.Close, 4);
rsi8 = RSI.Series(bars.Close, 8);
--in Execute--
Transaction t = PlaceTrade(bars, TransactionType.Buy, OrderType.Market, 0);
t.SetPositionMetric("RSI4", rsi4[idx]);
t.SetPositionMetric("RSI8", rsi8[idx]);
--private variables--
private RSI rsi4;
private RSI rsi8;
--in Initialize--
rsi4 = RSI.Series(bars.Close, 4);
rsi8 = RSI.Series(bars.Close, 8);
--in Execute--
Transaction t = PlaceTrade(bars, TransactionType.Buy, OrderType.Market, 0);
t.SetPositionMetric("RSI4", rsi4[idx]);
t.SetPositionMetric("RSI8", rsi8[idx]);
I totally missed that. That is fantastic!
Thanks!
Thanks!
Your Response
Post
Edit Post
Login is required