Custom Criteria Editor

Questions about MultiCharts and user contributed studies.
GuppyDRV
Posts: 57
Joined: 20 Jan 2017
Has thanked: 1 time
Been thanked: 2 times

Custom Criteria Editor

Postby GuppyDRV » 24 Apr 2020

Hello all,

I’m unable to cut and paste code into the Custom Criteria Editor! Any ideas as to why?

Additionally, is there a resource library available with sample codes above and beyond what’s native within MC that I might try?

Thanks for the help.

GuppyDRV

User avatar
JoshM
Posts: 2195
Joined: 20 May 2011
Location: The Netherlands
Has thanked: 1544 times
Been thanked: 1565 times
Contact:

Re: Custom Criteria Editor

Postby JoshM » 24 Apr 2020

is there a resource library available with sample codes above and beyond what’s native within MC that I might try?
There's a discussion here with several examples and more information.

But the Custom Criteria Editor is kind of the old way of defining a custom criteria, because now there's also the SetCustomFitnessValue keyword.

With `SetCustomFitnessValue()` there are a lot more options available. Plus you don't have to write JavaScript-like code but can simply use PowerLanguage in MultiCharts' regular editor.

GuppyDRV
Posts: 57
Joined: 20 Jan 2017
Has thanked: 1 time
Been thanked: 2 times

Re: Custom Criteria Editor

Postby GuppyDRV » 25 Apr 2020

JoshM,

Thanks for the input. I’ve tried using those, the built in Sharp Ratio, and it produces a division by zero error. This is attached to code that otherwise has traded without issue forever! I know I’m doing something wrong I just can’t figure out what that is!

GuppyDRV

User avatar
JoshM
Posts: 2195
Joined: 20 May 2011
Location: The Netherlands
Has thanked: 1544 times
Been thanked: 1565 times
Contact:

Re: Custom Criteria Editor

Postby JoshM » 27 Apr 2020

Thanks for the input. I’ve tried using those, the built in Sharp Ratio, and it produces a division by zero error. This is attached to code that otherwise has traded without issue forever! I know I’m doing something wrong I just can’t figure out what that is!
It doesn't have to be your mistake! It might also be that the script has a wrong input or calculation that makes it try to divide by zero. The built-in `SharpRatio` function does seem to handle possible division by zero errors well by checking for that.

One option to easier find the problem is to use `SetCustomFitnessValue()` in a separate signal rather than in the main signal. That way when there's an error you "only" have to troubleshoot that specific signal that sets the custom criteria. That might make the task a little more manageable!


Return to “MultiCharts”