Hi,
I have a signal that draws TLs and trades based on associated logic.
The signal itself draws the TLs and trades them fine ...
until I attempt to optimize it.
All attempts at optimization immediately produce a TL_New failure.
Example error:
This is in MC64 9.0 Build 10360. Is this a bug? Is there anything I can do about it?
Error optimizing trendline (TL) strategy
Error optimizing trendline (TL) strategy
- Attachments
-
- MC_TL_Opt_Error_01.png
- Error when optimizing TL strategy
- (7.93 KiB) Downloaded 1056 times
- TJ
- Posts: 7744
- Joined: 29 Aug 2006
- Location: Global Citizen
- Has thanked: 1033 times
- Been thanked: 2224 times
Re: Error optimizing trendline (TL) strategy
Without looking at your code and studying the details...Hi,
I have a signal that draws TLs and trades based on associated logic.
The signal itself draws the TLs and trades them fine ...
until I attempt to optimize it.
All attempts at optimization immediately produce a TL_New failure.
Example error:
This is in MC64 9.0 Build 10360. Is this a bug? Is there anything I can do about it?
I can say, it is most likely caused by the date/time. You see, the date/time do not increment in decimals during optimization.
Re: Error optimizing trendline (TL) strategy
Thanks TJ.
However, I'm a bit skeptical that that is issue.
The params to TL_New, in order are:
TL_New params - SwLoDate[1]: 1041122 SwLoTime[1]: 1800 SwLoVal[1]: 611.20 SwLoDate[0]: 1041209 SwLoTime[0]: 1800 SwLoVal[0]: 621.20
Nothing weird there.
The very first call to TL_New during the opt fails as shown, whereas when not optimizing the entire chart fills with TLs and simulates trades as it should.
Also, the same code optimizes fine in TS 9.1.
I'm thinking there may be some issue in MC involving the optimizer and the drawing objects.
I tried turning off multi-core opt as per here:
viewtopic.php?f=1&t=10663&hilit=core#p52794
but that did not seem to make any difference.
However, I'm a bit skeptical that that is issue.
The params to TL_New, in order are:
TL_New params - SwLoDate[1]: 1041122 SwLoTime[1]: 1800 SwLoVal[1]: 611.20 SwLoDate[0]: 1041209 SwLoTime[0]: 1800 SwLoVal[0]: 621.20
Nothing weird there.
The very first call to TL_New during the opt fails as shown, whereas when not optimizing the entire chart fills with TLs and simulates trades as it should.
Also, the same code optimizes fine in TS 9.1.
I'm thinking there may be some issue in MC involving the optimizer and the drawing objects.
I tried turning off multi-core opt as per here:
viewtopic.php?f=1&t=10663&hilit=core#p52794
but that did not seem to make any difference.
- Henry MultiСharts
- Posts: 9165
- Joined: 25 Aug 2011
- Has thanked: 1264 times
- Been thanked: 2957 times
Re: Error optimizing trendline (TL) strategy
Hello MC_Prog,
If you still need help with this error - please send us (support@multicharts.com) the following information for further investigation:
- workspace you are using;
- in QuoteManager select the symbol you are using, make a right click on it->Export data->Export instrument (without data). Send me the Qmd export file for analysis;
- in PowerLanguage editor->File->Export->export with dependent functions the studies you are using in the workspaces you are providing. Send me the study export file;
- step by step instructions for replicating the error.
If you still need help with this error - please send us (support@multicharts.com) the following information for further investigation:
- workspace you are using;
- in QuoteManager select the symbol you are using, make a right click on it->Export data->Export instrument (without data). Send me the Qmd export file for analysis;
- in PowerLanguage editor->File->Export->export with dependent functions the studies you are using in the workspaces you are providing. Send me the study export file;
- step by step instructions for replicating the error.
Re: Error optimizing trendline (TL) strategy
Hello MC_Prog,Hi,
I have a signal that draws TLs and trades based on associated logic.
The signal itself draws the TLs and trades them fine ...
until I attempt to optimize it.
All attempts at optimization immediately produce a TL_New failure.
Example error:
This is in MC64 9.0 Build 10360. Is this a bug? Is there anything I can do about it?
Did you get this issue resolved? I have some signals with "tl_new" in them and it trades fine but I cannot optimise them. They backtest and trade with no issues but optimisation produces nothing. All fitness criteria columns show zero in each box.
Could you share how you resolved it please? I would love to be able to optimise signals that draw trendlines.
Picture of optimisation report window below, showing 0.00 in all fields.
- Attachments
-
- Optim_report.png
- Picture of optimisation report window below, showing 0.00 in all fields.
- (85.51 KiB) Downloaded 1116 times
Last edited by mrticks on 02 Feb 2015, edited 1 time in total.
Re: Error optimizing trendline (TL) strategy
Hi. Unfortunately, I have no solution at this time.
As I mentioned above, the very first call to TL_New() fails if done while optimizing.
IMO, this is a bug in MC, and I would be surprised if they could not immediately reproduce it.
As I mentioned above, the very first call to TL_New() fails if done while optimizing.
IMO, this is a bug in MC, and I would be surprised if they could not immediately reproduce it.
Last edited by MC_Prog on 02 Feb 2015, edited 1 time in total.
Re: Error optimizing trendline (TL) strategy
Thanks for the response. I've seen a project request for this feature and have voted for it.Hi. Unf. I have no solution at this time. IMO, this is a bug in MC.
Re: Error optimizing trendline (TL) strategy
I have a different issue to you, when I kick off an optimisation it looks like it is working but when finished produces zero parameters. All parameters show a field with 0.00 in them. It is a shame, as it would be really good to have this ability.Hi. Unfortunately, I have no solution at this time.
As I mentioned above, the very first call to TL_New() fails if done while optimizing.
IMO, this is a bug in MC, and I would be surprised if they could not immediately reproduce it.
Thanks for taking a look.
- ABC
- Posts: 723
- Joined: 16 Dec 2006
- Location: www.abctradinggroup.com
- Has thanked: 125 times
- Been thanked: 410 times
- Contact:
Re: Error optimizing trendline (TL) strategy
MC ignores Trendlines in the optimization. Therefore without modifying the code you can't optimize the signals. The usual result is that of mrticks - an optimization report containing zeros for all combinations.
However I can imagine that this can create other issues like runtime errors, too.
Regards,
ABC
However I can imagine that this can create other issues like runtime errors, too.
Regards,
ABC
Re: Error optimizing trendline (TL) strategy
MC ignores Trendlines in the optimization. Therefore without modifying the code you can't optimize the signals. The usual result is that of mrticks - an optimization report containing zeros for all combinations.
However I can imagine that this can create other issues like runtime errors, too.
Regards,
ABC
Hi ABC,
Thanks for the response.
When you say, "Therefore without modifying the code you can't optimize the signals." Does that mean it is possible to optimise trendline signals by modifying the code somehow? If so, would you have a sample of this?
- ABC
- Posts: 723
- Joined: 16 Dec 2006
- Location: www.abctradinggroup.com
- Has thanked: 125 times
- Been thanked: 410 times
- Contact:
Re: Error optimizing trendline (TL) strategy
Yes, this is what I mean. I don't have a sample code, but think of it like this:
When you draw a trendline you know the start and end point. So you can compute the slope and with this you can compute every point in the future. With that it's simple to substitute the trendlines.
Regards,
ABC
When you draw a trendline you know the start and end point. So you can compute the slope and with this you can compute every point in the future. With that it's simple to substitute the trendlines.
Regards,
ABC
Hi ABC,
Thanks for the response.
When you say, "Therefore without modifying the code you can't optimize the signals." Does that mean it is possible to optimise trendline signals by modifying the code somehow? If so, would you have a sample of this?
- ABC
- Posts: 723
- Joined: 16 Dec 2006
- Location: www.abctradinggroup.com
- Has thanked: 125 times
- Been thanked: 410 times
- Contact:
Re: Error optimizing trendline (TL) strategy
Hello,
I bumped into exact same problem with latest MC14: backtest with TL is Okay but optimization is broken (full of zeros as seen above). What's the deal ? Is it a known MC bug ? Is it a coding issue ? I just use TL_New(), TL_SetEnd() and TL_GetValue() keywords, nothing fancy.
Very frustrating
I bumped into exact same problem with latest MC14: backtest with TL is Okay but optimization is broken (full of zeros as seen above). What's the deal ? Is it a known MC bug ? Is it a coding issue ? I just use TL_New(), TL_SetEnd() and TL_GetValue() keywords, nothing fancy.
Very frustrating
- lingwuchung
- Posts: 50
- Joined: 03 Feb 2014
- Has thanked: 6 times
Re: Error optimizing trendline (TL) strategy
Not surprisng to me at all and I am actually grateful if it does. I found that TL is adding unnecessary burden in optimizatin. You don't need to plot and see any every line in optimization. Therefore my signal will automatically switch off TL within my code by using:Intentionally? This is very surprising to me.MC ignores Trendlines in the optimization.
if GetAppInfo(aioptimizing) = 1 then begin
ShowTL = false;
end else begin
ShowTL = true;
end;
- lingwuchung
- Posts: 50
- Joined: 03 Feb 2014
- Has thanked: 6 times
Re: Error optimizing trendline (TL) strategy
Change your code to skip TL during optimization. You will appreciate the amount of time saved in optimization.Hi,
I have a signal that draws TLs and trades based on associated logic.
The signal itself draws the TLs and trades them fine ...
until I attempt to optimize it.
All attempts at optimization immediately produce a TL_New failure.
Example error:
This is in MC64 9.0 Build 10360. Is this a bug? Is there anything I can do about it?
Re: Error optimizing trendline (TL) strategy
So one actually needs to recreate maths behind TLs and substitue them in order to optimize them ? Oh well...
[Edit] Okay, for those wondering, I found a workaround by using these functions to compute TLs without actually drawing them:
http://help.TS.com/10_00/eng/ ... ction_.htm
http://help.TS.com/10_00/eng/ ... ction_.htm
[Edit] Okay, for those wondering, I found a workaround by using these functions to compute TLs without actually drawing them:
Code: Select all
TLValue(StartPrice, StartBar, EndPrice, EndBar, TgtBar)
or
TLValueEasy(Price, StartBar, EndBar, TgtBar)
http://help.TS.com/10_00/eng/ ... ction_.htm
Re: Error optimizing trendline (TL) strategy
I just try that and did not notice any difference in optimization time. I guess, as already mentionned, MC just skips TLs during optimization: so no need to switch them off.Not surprisng to me at all and I am actually grateful if it does. I found that TL is adding unnecessary burden in optimizatin. You don't need to plot and see any every line in optimization. Therefore my signal will automatically switch off TL within my code by using:
if GetAppInfo(aioptimizing) = 1 then begin
ShowTL = false;
end else begin
ShowTL = true;
end;
- lingwuchung
- Posts: 50
- Joined: 03 Feb 2014
- Has thanked: 6 times
Re: Error optimizing trendline (TL) strategy
Ok. Maybe MC can skip the TL calls but it won’t skip other calculations before and after the TL. So I still prefer to skip them as well.I just try that and did not notice any difference in optimization time. I guess, as already mentionned, MC just skips TLs during optimization: so no need to switch them off.Not surprisng to me at all and I am actually grateful if it does. I found that TL is adding unnecessary burden in optimizatin. You don't need to plot and see any every line in optimization. Therefore my signal will automatically switch off TL within my code by using:
if GetAppInfo(aioptimizing) = 1 then begin
ShowTL = false;
end else begin
ShowTL = true;
end;
How many bars are u playing and how much time does it take to run one round?
Re: Error optimizing trendline (TL) strategy
Few thousands bars and few minutes optimizing... but nevermind my issue was about being able to optimize TLs, not about how long it would take. the TLValue() function does the trick.
- lingwuchung
- Posts: 50
- Joined: 03 Feb 2014
- Has thanked: 6 times
Re: Error optimizing trendline (TL) strategy
ok, few thousands bars and few minutes shouldn't make a big difference. Mine is talking about 100K bars, 10K optimization possiblities and 10-20 hours to complete.Few thousands bars and few minutes optimizing... but nevermind my issue was about being able to optimize TLs, not about how long it would take. the TLValue() function does the trick.