Single advise model for portfolio

Posted By: jmlocatelli

Single advise model for portfolio - 09/19/20 22:24

Hi,
I've developed a code to trade based on candle patterns using advise functions with PATTERN method. It runs fine on a list of assets, creating a specific set of rules for every symbol in the list.
But, as I'm looking for candle patterns across all symbols, I would like to create a common set of rules for all assets.
Is it possible? And how?
Thanks in advance,

Regards,
JM
Posted By: jmlocatelli

Re: Single advise model for portfolio - 09/21/20 19:41

This is part of the code:


string Name;
while(Name = loop(Assets))
{
asset(Name);
var SignalLong = adviseLong(PATTERN+FUZZY+RETURNS +3,0,
priceHigh(2),priceLow(2),priceClose(2),priceOpen(1),
priceHigh(1),priceLow(1),priceClose(1),priceOpen(0),
priceHigh(0),priceLow(0),priceClose(0),priceOpen(-1)
);
var SignalShort = adviseShort(PATTERN+FUZZY+RETURNS +3,0,
priceHigh(2),priceLow(2),priceClose(2),priceOpen(1),
priceHigh(1),priceLow(1),priceClose(1),priceOpen(0),
priceHigh(0),priceLow(0),priceClose(0),priceOpen(-1)
);
if(SignalLong>SignalThreshold)
enterLong();
if(SignalShort>SignalThreshold)
enterShort();
}

It creates one set of rules for each symbol in the assetList. And this is ok.

My question is how to create a single/common set of rules for all assets in the assetList.
© 2024 lite-C Forums