Welcome to NexusFi: the best trading community on the planet, with over 150,000 members Sign Up Now for Free
Genuine reviews from real traders, not fake reviews from stealth vendors
Quality education from leading professional traders
We are a friendly, helpful, and positive community
We do not tolerate rude behavior, trolling, or vendors advertising in posts
We are here to help, just let us know what you need
You'll need to register in order to view the content of the threads and start contributing to our community. It's free for basic access, or support us by becoming an Elite Member -- see if you qualify for a discount below.
-- Big Mike, Site Administrator
(If you already have an account, login at the top of the page)
So in the optimizer I have a variable (BestQuantity) I can set to between 3 >> 9, that would interact with the values selected in the optimizer for the QPT1, QPT2, QPT3 ... ie:
So ... if at a point the optimizer has BestQuantity =9 and also selected 7 for QPT1, then it has to select QPT2 + QPT3 == total of 2 in whatever 'mix' and so on to allow the optimizer to select the best result for whatever the # of times the ProfitTargets happen to be filled.
I can setup properties, but when I tried to make " BestQuantity = (QPT1 + QPT2 + QPT3);" I have error on compile::
Only assignment, call, increment, decrement, and new object expressions can be used as a statement,CS0201
An assist would be greatly appreciated,
Jon
update:
I managed to have a successful compile, but the logic is flawed
This is from the Strategy Analyzer Settings:
BestQuantity 16 (3;9;1),
Quantity ProfitTarget 1 4 (3;7;1),
Quantity ProfitTarget 2 6 (0;6;1),
Quantity ProfitTarget 3 6 (0;6;1),
Quantity ProfitTarget 4 1
As you can see, the 'BestQuantity' optimized result is the addition of the maximum values selected for optimization (6+6+4 = 16), instead of the 9 intended.
Code used was in 'Initialize' :: BestQuantity = QPT1 + QPT2 + QPT3 .. BestQuantity and the QPTs are int variables
Can you help answer these questions from other members on NexusFi?
I'm having a hard time understanding your post. Perhaps screen shots, or c# code itself is in order.
But, I can tell you that when I design a strategy with multiple targets, I make those additional targets a cumulative total of the targets before them. This is just to make the optimizer make a bit more sense.
Thanks for the input. I am trying to analyse for the best quantity of each target size. The actual size of each target isnt a factor AFAIK in the solution I am looking for. Target sizes in the strategy do progress in size.
Attached a screenshot of the optimizer setup and output showing the optimized # of trades per target add up to (here it is 7+5+1=13) which is more than the limitation set up by the 'QuantitySQ3' of 9, or the Strategy Analyzer optimized amount of 8 . On screen also are the only parts of the code that are actually involved in the 'QuantitySQ3' == the int variables for the quantity for each target and the total quantity allowed by QuantitySQ3.
NT support suggests that this is too complex for the backtester to complete, and doesnt even suggest it is possible with custom programming. I still have a feeling that a custom optimization type might accomplish the job, so I havent given up ... just have other more urgent code to build ...
IF anyone has thoughts ... someone that sees how useful this might be .. maybe we can build something
But, I can tell you that when I design a strategy with multiple targets, I make those additional targets a cumulative total of the targets before them. This is just to make the optimizer make a bit more sense.
This just makes the optimizer always go in a logical order, like target 3 is not smaller than target 1.
Mike
Mike,
I always did wonder why you did that progression. For clarification, does this actually make a difference during optimization even if my targets would be in a pregressive order anyway? ... and if yes, in what way.
I am wonder though that 'maybe' the idea of adding quantity values together in some type of subroutine might be a step towards accomplishing the optimization of quantity per profit target I am looking for.