Error optimizing trendline (TL) strategy  [SOLVED]

Questions about MultiCharts and user contributed studies.
User avatar
MC_Prog
Posts: 330
Joined: 28 Feb 2007
Has thanked: 64 times
Been thanked: 34 times

Error optimizing trendline (TL) strategy

Postby MC_Prog » 18 Jan 2015

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:

Image

This is in MC64 9.0 Build 10360. Is this a bug? Is there anything I can do about it?
Attachments
MC_TL_Opt_Error_01.png
Error when optimizing TL strategy
MC_TL_Opt_Error_01.png (7.93 KiB) Viewed 938 times

User avatar
TJ
Posts: 7151
Joined: 29 Aug 2006
Location: Global Citizen
Has thanked: 988 times
Been thanked: 2041 times

Re: Error optimizing trendline (TL) strategy

Postby TJ » 18 Jan 2015

MC_Prog wrote: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:
Image
This is in MC64 9.0 Build 10360. Is this a bug? Is there anything I can do about it?

Without looking at your code and studying the details...
I can say, it is most likely caused by the date/time. You see, the date/time do not increment in decimals during optimization.
These users thanked the author TJ for the post:
Andrew MultiCharts

User avatar
MC_Prog
Posts: 330
Joined: 28 Feb 2007
Has thanked: 64 times
Been thanked: 34 times

Re: Error optimizing trendline (TL) strategy

Postby MC_Prog » 19 Jan 2015

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.

User avatar
Henry MultiСharts
Posts: 9064
Joined: 25 Aug 2011
Has thanked: 1256 times
Been thanked: 2911 times

Re: Error optimizing trendline (TL) strategy

Postby Henry MultiСharts » 29 Jan 2015

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.

mrticks
Posts: 19
Joined: 19 Apr 2012
Has thanked: 2 times

Re: Error optimizing trendline (TL) strategy

Postby mrticks » 02 Feb 2015

MC_Prog wrote: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:

Image

This is in MC64 9.0 Build 10360. Is this a bug? Is there anything I can do about it?


Hello MC_Prog,

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.
Optim_report.png (85.51 KiB) Viewed 998 times
Last edited by mrticks on 02 Feb 2015, edited 1 time in total.

User avatar
MC_Prog
Posts: 330
Joined: 28 Feb 2007
Has thanked: 64 times
Been thanked: 34 times

Re: Error optimizing trendline (TL) strategy

Postby MC_Prog » 02 Feb 2015

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.
Last edited by MC_Prog on 02 Feb 2015, edited 1 time in total.

mrticks
Posts: 19
Joined: 19 Apr 2012
Has thanked: 2 times

Re: Error optimizing trendline (TL) strategy

Postby mrticks » 02 Feb 2015

MC_Prog wrote:Hi. Unf. I have no solution at this time. IMO, this is a bug in MC.


Thanks for the response. I've seen a project request for this feature and have voted for it.

Image

mrticks
Posts: 19
Joined: 19 Apr 2012
Has thanked: 2 times

Re: Error optimizing trendline (TL) strategy

Postby mrticks » 02 Feb 2015

MC_Prog wrote: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.


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.

Thanks for taking a look.

User avatar
ABC
Posts: 626
Joined: 16 Dec 2006
Has thanked: 119 times
Been thanked: 355 times
Contact:

Re: Error optimizing trendline (TL) strategy  [SOLVED]

Postby ABC » 03 Feb 2015

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
These users thanked the author ABC for the post:
Henry MultiСharts

mrticks
Posts: 19
Joined: 19 Apr 2012
Has thanked: 2 times

Re: Error optimizing trendline (TL) strategy

Postby mrticks » 03 Feb 2015

ABC wrote: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?

User avatar
ABC
Posts: 626
Joined: 16 Dec 2006
Has thanked: 119 times
Been thanked: 355 times
Contact:

Re: Error optimizing trendline (TL) strategy

Postby ABC » 03 Feb 2015

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

mrticks wrote: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?

User avatar
MC_Prog
Posts: 330
Joined: 28 Feb 2007
Has thanked: 64 times
Been thanked: 34 times

Re: Error optimizing trendline (TL) strategy

Postby MC_Prog » 03 Feb 2015

ABC wrote:MC ignores Trendlines in the optimization.
Intentionally? This is very surprising to me.

User avatar
ABC
Posts: 626
Joined: 16 Dec 2006
Has thanked: 119 times
Been thanked: 355 times
Contact:

Re: Error optimizing trendline (TL) strategy

Postby ABC » 03 Feb 2015

Yes, intentionally.


Return to “MultiCharts”