Idea for a Trailing Stop Strategy

If you need an Indicator or Signal developed or translated from other language, please post all Indicator development REQUESTS to this section here.

Moderator: admin

Re: Idea for a Trailing Stop Strategy

Postby loseend » Fri Aug 17, 2018 6:25 am

can someone tell me how to make math.min/max ignore a nil value?

I guess it's a stpuid question but I wanna know:

math.min(1, 2, 3, nil value) - Id like the result to be 1 instead of an error call.

the variable I assigned for the math.min calculation most of the time is being faded for the condition isnt met - only if met the variable will return a number, meanwhile though math.min gets calculated.

I circumvented the problem and it does work fine but it feeds up the code lines making them hideous and unclear. I d rather would stick to the math.min thing.

So does anyone know an answer to a stupid question?
loseend
 
Posts: 56
Joined: Tue Jul 31, 2018 12:37 pm

Re: Idea for a Trailing Stop Strategy

Postby loseend » Fri Aug 17, 2018 10:50 am

Problem solved. Thx.
loseend
 
Posts: 56
Joined: Tue Jul 31, 2018 12:37 pm

Previous

Return to Indicator and Signal Requests

Who is online

Users browsing this forum: Google [Bot] and 11 guests

cron