Can you please add the option to modify orders in a strategy by a ratio with a round down and round up option.
For example if 3 orders in a strategy are 0.02, 0.05, 0.04 lots (with trade size decimals = 2) and a 50% or 0.5x ratio adjustment is applied, this option will modify orders with the round down option to 0.01, 0.02 and 0.02 lots and the round up option will modify to 0.01, 0.03 and 0.02 lots and all trading statistics will be modified accordingly e.g. profit or loss etc.
Status changed from New to Fixed
...
@Override public double computeTradeSize(SQOrder order, double tickSize, double pointValue) throws Exception { return order.Size / 2; }
I have very little understanding of how java works and don't know how to implement this snippet to make it work.
Can you please give me some instructions for this.
I'm assuming this is not the complete code and that I need to combine it with other code to make it work?
Where do I put this?
How do I make sure it works?
How do I use it?
How do I modify a strategy and automatically save it back to a databank?
What else do I need to know?
Attachment PctAmount.java added
Copy the snippet from the attachment to your QA installation directory \extend\MoneyManagementTypes\PctAmount.java and restart QA.
If you want to edit the snippet do it via QuantEditor.
Attachment NormaliseDrawdown.java added
Attachment NormaliseDrawdown.java deleted
Attachment NormaliseDrawdown.java added
I played around with this and worked on understanding java and the QuantEditor and I managed to succeed with creating a whatIf snippet that does this :)
I also managed to get it to work with my bulk whatif script that you and Tomas sent me too and was very happy with this.
However, I want to extend this further by normalising Drawdown $ for each strategy and I've got the script doing that, but only when I enter a static Current Drawdown value. I've tried very hard to find a way to get the Drawdown value for the strategy I'm working with into a variable called currDD, but can't find a way when looking at other scripts. It looks very complex and I'm stumped.
Can you please help?
Current script attached
Attachment NormaliseDrawdown.java added
Attachment WhatIf.jpg added
Attachment WhatIfBulk.java added
Attachment WhatIf Results.png added
It works like a charm :) and it works even better with the WhatifBulk script too!! :)
Can I ask for one more favour. How do I transfer the note from the original stratregy to the new What If strategy as per the picture (attached) using my WhatifBulk script (also attached)?
Thanks :)
Attachment setNote.jpg added
Attachment Results.png added
It wasn't quite what I was looking for, but I was able to figure out the rest and ultimately used strategyResultsNew.set("Note", rg.get("Note")); to give me exactly what I was looking for.