I am slowly trying to learn how to program, but spent several hours here now and couldnt get this one. I want to set a position priority based on price and volume, where any position with the highest price x volume would be assigned the highest priority. I am trying to implement this in the LDL2 strategy. Can someone please give this a stab.
CODE:
Please log in to see this code.
Size:
Color:
QUOTE:
where any position with the highest price x volume would be assigned the highest priority
Probably something like this:
CODE:
Please log in to see this code.
Size:
Color:
Thanks Eugene. Seems like that worked but had to change limit to limitPrice. Could you tell me how would set the priority for positions with the lowest price to sales ratio?
Size:
Color:
Yep, it's limitPrice -- coded on-the-fly.
Re: price to sales - sure, see FundamentalDataSeries in the QuickRef > Fundamental Data. It's just another DataSeries, like Volume or Close. Specify the necessary fundamental item name in the itemName parameter (hint: see WLP fundamental User Guide PDF) and make sure that your fundamental data sources have been updated prior to running the resulting code.
Size:
Color: