I am using the "Portfolio_OpenPositionProfit" function in my signals, which can only be used in the portfolio backtester.
As to be expected, when I insert my signal on a chart, I get an error.
Has anyone found a way to make such signals work in a chart, e.g. with an íf' statement that can understand if the signal is running on a chart or in the portfolio optimiser?
Basically I would like to avoid having two signals doing the same job, which increases the risk of mistakes and inconsistencies.
Thanks a lot
Andreas
How to handle Portfolio_OpenPositionProfit in a chart [SOLVED]
Re: How to handle Portfolio_OpenPositionProfit in a chart [SOLVED]
I am using the "Portfolio_OpenPositionProfit" function in my signals, which can only be used in the portfolio backtester.
As to be expected, when I insert my signal on a chart, I get an error.
Has anyone found a way to make such signals work in a chart, e.g. with an íf' statement that can understand if the signal is running on a chart or in the portfolio optimiser?
Basically I would like to avoid having two signals doing the same job, which increases the risk of mistakes and inconsistencies.
Thanks a lot
Andreas
Code: Select all
if 1=getappinfo(aiisportfoliomode) then print("portfolio");
Re: How to handle Portfolio_OpenPositionProfit in a chart
Dru, thanks again for the code.
Please let me ask. where did you find the 'aiisportfoliomode' word? I searched all the MC help files, wikis etc etc, and I can't find it anywhere!
I am wondering if there is an updated manual or something, that I am not aware of.
Take care
Andreas
Please let me ask. where did you find the 'aiisportfoliomode' word? I searched all the MC help files, wikis etc etc, and I can't find it anywhere!
I am wondering if there is an updated manual or something, that I am not aware of.
Take care
Andreas
- JoshM
- Posts: 2195
- Joined: 20 May 2011
- Location: The Netherlands
- Has thanked: 1544 times
- Been thanked: 1565 times
- Contact:
Re: How to handle Portfolio_OpenPositionProfit in a chart
Good question, I can't find it either. Though the word does pop-up in the 'intellisense' feature of the PowerLanguage Editor, but without a help description.where did you find the 'aiisportfoliomode' word? I searched all the MC help files, wikis etc etc, and I can't find it anywhere!