In my WL6 strategy I used a Tuple to bring several indicator series and strings from the bar by bar section to the display section. With WL7 code, I'm not sure how to handle the Tuple declaration with
declaration.
Is there a simple way to handle this.
So far I'm very impressed the results of my converted WL6 strategy to WL7. I tested my 10 stock portfolio and was able to adjust the decision parameter to achieve a greater over all return.
CODE:
public override void Execute(BarHistory bars, int idx)
declaration.
Is there a simple way to handle this.
So far I'm very impressed the results of my converted WL6 strategy to WL7. I tested my 10 stock portfolio and was able to adjust the decision parameter to achieve a greater over all return.
Rename
Gary, I remember these conversations on WL6 forum regarding usage of Tuple. (https://wl6.wealth-lab.com/Forum/Posts/Return-Tuple-40514 and https://wl6.wealth-lab.com/Forum/Posts/Return-more-than-one-DataSeries-40511). The Tuple syntax per se hasn't changed in .NET Core.
Could you expand on what the stopping point is? Also, chances are you may not need your previous Tuple solution because the backtester in WL7 has changed significantly and so displaying a DataSeries of Gain/Loss for the stock backtest (which was the reason behind Tuples) may be handled differently now.
Could you expand on what the stopping point is? Also, chances are you may not need your previous Tuple solution because the backtester in WL7 has changed significantly and so displaying a DataSeries of Gain/Loss for the stock backtest (which was the reason behind Tuples) may be handled differently now.
Eugene,
I don't think Tuple is compatible with your
I don't think Tuple is compatible with your
CODE:class. I agree that I should try to use the class to bring the data back to the display section. Is there a way I can modify the
public override void Execute(BarHistory bars, int idx)
CODE:so that I add the data items to get the data to display.
public override void Execute(BarHistory bars, int idx)
Gary, please review 2nd paragraph of my reply above. Let's focus on your goal and then we decide if Tuples are necessary or not.
Eugene,
I have not been able to figure out how to use a Tuple with WL7, at least as yet.
In my WL6 strategy I used a Tuple to separate the bar iteration area and display. I used
Then at the bottom I used
Then in the display section I used
All of this works like charm.
When I attempt this in WL7, I get error messages as if it is not compatible. Today I will try to see if I can use a Tuple using different format.
I have not been able to figure out how to use a Tuple with WL7, at least as yet.
In my WL6 strategy I used a Tuple to separate the bar iteration area and display. I used
CODE:to do this.
public Tuple<DataSeries, DataSeries, DataSeries, DataSeries, string, string, string > GetTradeLoop(DataSeries dsoInd)
Then at the bottom I used
CODE:That collects the data.
Tuple<DataSeries, DataSeries, DataSeries, DataSeries,string, string, string > myTuple = new Tuple<DataSeries, DataSeries, DataSeries, DataSeries ,string, string, string >(dblGainLoss, Buy_Disp, Sell_Disp, dblPctDrop, strNxtDayStop, strNxtBarSellStop, strDosAdjFact ); //PrintDebug(tempGainLoss[1400]); return myTuple;
Then in the display section I used
CODE:
//get the Tuple data Tuple<DataSeries, DataSeries, DataSeries, DataSeries, string, string, string> temp = GetTradeLoop(dso); dblGainLoss = temp.Item1; Buy_Disp = temp.Item2; Sell_Disp = temp.Item3; dblPctDrop = temp.Item4; strNxtDayStop = temp.Item5; strNxtBarSellStop = temp.Item6; strDosAdjFact = temp.Item7;
All of this works like charm.
When I attempt this in WL7, I get error messages as if it is not compatible. Today I will try to see if I can use a Tuple using different format.
QUOTE:
In my WL6 strategy I used a Tuple to separate the bar iteration area and display.
Gary, that's what I mean when saying that Tuples may not be required at all. In WL7 the bar iteration and display are already separate by design. (In addition, strategies now can inherently access the portfolio equity curve). Please see Strategy Execution section in the API document below:
https://www.wealth-lab.com/Support/ApiReference/UserStrategyBase
You have a good hint. I was able to add text to the "Price" pane from the Execute section. I will continue along this line.
Thank you Eugene,
Thank you Eugene,
Your Response
Post
Edit Post
Login is required