+1 888 340 6572

Portfolio Trader Strategy Examples: Difference between revisions

From MultiCharts
No edit summary
Line 332: Line 332:


<syntaxhighlight>once if 1 <> getappinfo(aiisportfoliomode)
<syntaxhighlight>once if 1 <> getappinfo(aiisportfoliomode)
then raiseruntimeerror("Portfolio Rank Money Management Signal can be applied for MCPortfolio application only.");
then raiseruntimeerror("Portfolio Rank Money Management Signal can be applied for MCPortfolio application only.");


once if pmms_strategies_count() > 10000 then raiseruntimeerror("Portfolio Rank Money Management Signal too much instruments, max value = " + numtostr(100000, 0));
once if pmms_strategies_count() > 10000
 
then raiseruntimeerror
 
("Portfolio Rank Money Management Signal too much instruments, max value = " + numtostr(100000, 0));
 
once if pmms_strategies_count() < BuyBestN + SellWorseN


once if pmms_strategies_count() < BuyBestN + SellWorseN then raiseruntimeerror("Portfolio Rank Money Management Signal, please check inputs, BuyBestN + SellWorseN should be less or equal to tradable Instruments number");
then raiseruntimeerror
 
("Portfolio Rank Money Management Signal, please check inputs, BuyBestN + SellWorseN should be less or equal to tradable Instruments number");
</syntaxhighlight>
</syntaxhighlight>


Line 387: Line 396:


if TraceOutput then
if TraceOutput then
print("CurrentBar = ", currentbar:0:0, ". Allow LONG for symbol ", pmms_strategy_symbol(strIdx), ", Contracts = ", ContractsForEntry[strIdx]);
print("CurrentBar = ", currentbar:0:0, ".
 
Allow LONG for symbol ", pmms_strategy_symbol(strIdx), ", Contracts = ", ContractsForEntry[strIdx]);
end;
end;
</syntaxhighlight>
</syntaxhighlight>