I have written a strategy to buy at limit among a dataset, but due to the limitation of capital , would like to only trade the 5 symbols with biggest daily drop within the my buy signals. By studying the "RSI Rotation" example, I know how to code to get the biggest daily drop from my dataset but my question is I would like to get the biggest daily drop from my alert list but not whole dataset.
Is it possible to do so? If yes, may I have the example code of it?
Thanks!
Size:
Color:
Assign the daily drop figure to Position.Priority. Strip the minus sign to take the biggest losers i.e.
QUOTE:
-ROC.Series(Close,1)[bar]
In the
Position Options PosSizer, activate "Max open positions" and enter "5" in the input field.
In addition, you can configure the "Priority" field there to take only trades with a priority below some threshold e.g. still take 5 trades but only if the biggest drop (assigned via the Position.Priority) was worse than e.g. -2.0.
Size:
Color:
I made it exactly what I want to. Eugene, really thanks for your help!
Size:
Color:
Eugene,
I am trying to perform the same task as it is stated in the post's name but I can't make it work.
My strategy buys at limit at a specified level (calculated from daily data) and exits the position at the end of the day. So this is an intraday strategy but utilising only daily data. See below for part of the code.
CODE:
Please log in to see this code.
I test that with S&P 500 and limit the max open positions to 100, each one sized at 1% of the available equity.
I check the Signal Names as of 3rd of December 2012 but the trades on the 4th of November are not correct based on priorities.
Could you provide some help please?
Christos
Size:
Color:
Everything works correctly for me. Don't forget that signal names are inverted (i.e. biggest negative numbers are the day's biggest winners and vice versa).
Note that sorting by Signal Name on Alerts tab is string-based. It does not correctly reflect priorities in a DataSet because these are double values, and signal names are strings. Take a look and see for yourself:
By the way, I'd recommend to check for LastPosition not being null to avoid exiting a unrelated Position or producing a potential NullReferenceException if a BuyAtLimit fails:
CODE:
Please log in to see this code.
Size:
Color:
Maybe I haven't correctly described what I want to do. I will give an example.
Assuming that on day one I get 400 Limit buy order alerts, each one given a certain priority. What I would like to do, is actually reduce the amount of alerts to 100 based on that priority.
From my understanding, the solution suggested on the previous posts does not limit the number of alerts to 100, but the number of trades (conditional on exceeding the position sizer threshhold) executing by highest priority.
It seems to me that what I want to achieve can only be done via a rotation strategy where I would create and sort a list of symbols based on certain values.
Size:
Color:
QUOTE:
From my understanding, the solution suggested on the previous posts does not limit the number of alerts to 100,
Yes it does. Invert the ROC (done), assign the priority (done), set the number to 100 (done), click the "Max open positions" button, you're done. Have you enabled the option by clicking that button?
Size:
Color:
Yes, I have enabled the option and I see 490 alerts.
Size:
Color:
Sorry, until now I didn't realize you were talking about alerts. Please disregard.
Reducing the amount of alerts can be done in PosSizer, but a live bug will not let you do it in 6.4: "QC 62853 In PosSizers, the Candidates list is empty for Alert sizing".
Size:
Color: