I notice the multicharts 14 new features.
one of these is
"
PowerLanguage: Improved the operation of “Recalculate” keyword in Portoflio Trader. “Recalculate” command will recalculate the whole portfolio now. Also, variables of RecalcPersist type are no longer supported in Portfolio Trader.
Is there any more information about recalculate command for portfolio trader?
such as,
how to use recalculate command in PT ?
is it suppored in strategy signal only (left part of PT) or in money management signal only (right part of PT) or both ?
Thanks.
Information about Recalculate Command ?
- Svetlana MultiCharts
- Posts: 645
- Joined: 19 Oct 2017
- Has thanked: 3 times
- Been thanked: 163 times
Re: Information about Recalculate Command ?
Hi maison6579,
You may want to test this sample script in Portfolio Trader
It can be called from any part of PT.
You may want to test this sample script in Portfolio Trader
Code: Select all
Var: ReCalcPersist recalc_once(True);
// do not use recalcpersist in portfolio, it only works in charting
Var: pf_recalconce(true), gvVal(0), gvErr(0);
var: vo10(0);
const: portfolioAppType(10);
If LastBarOnChart Then Begin
Print ("Last bar volume = ", Volume);
if (getappinfo(aiapplicationtype) <> portfolioAppType) then begin
If recalc_once Then Begin
Print ("Recalculate study!");
recalc_once = False ;
ReCalculate;
End;
end
else begin
pf_recalconce = pmm_get_global_named_num("RecalcOnce") = 0;
If pf_recalconce Then Begin
Print("Recalculate portfolio strategies!");
pmm_set_global_named_num("RecalcOnce", -1);
ReCalculate;
End;
end;
end;
-
- Posts: 3
- Joined: 04 Dec 2013
Re: Information about Recalculate Command ?
Thanks Svetlana for this reply.
However, I find a bug about this recalculate feature.
The portfolio trader(PT) recalculate-command works.
However, The right side information of PT , including (position, open P/L, even the Custom Text) could not refresh again after the recalculate is done.
The weird thing is that I add some print code and it still runs silently in the background.
====
the multicharts version: MultiCharts 14.0 Release 4 build 23013
os: win10
However, I find a bug about this recalculate feature.
The portfolio trader(PT) recalculate-command works.
However, The right side information of PT , including (position, open P/L, even the Custom Text) could not refresh again after the recalculate is done.
The weird thing is that I add some print code and it still runs silently in the background.
====
the multicharts version: MultiCharts 14.0 Release 4 build 23013
os: win10
- Svetlana MultiCharts
- Posts: 645
- Joined: 19 Oct 2017
- Has thanked: 3 times
- Been thanked: 163 times
Re: Information about Recalculate Command ?
We have reproduced the issue: the calculation works, but it is not displayed in the GUI. Sorry for inconvenience. Our engineers will work on improving this behaviour to include the fix in one of the future versions.