ta-lib-python icon indicating copy to clipboard operation
ta-lib-python copied to clipboard

Result of MACD when signalperiod = 1?

Open ojipadeson opened this issue 5 years ago • 7 comments

When setting signalperiod = 1 in function MACD, the last two results of the bar value is not in a stable condition, and always approaching 0. How the function calculates when signalperiod = 1? Why the function can accept signalperiod = 1?

ojipadeson avatar Aug 12 '20 02:08 ojipadeson

You could look through the source code:

https://github.com/TA-Lib/ta-lib/blob/master/src/ta_func/ta_MACD.c

I don’t believe that’s a valid parameter value, though. But don’t have time to investigate right now.

On Aug 11, 2020, at 7:42 PM, ojipadeson [email protected] wrote:

 When setting signalperiod = 1 in function MACD, the last two results of the bar value is not in a stable condition, and always approaching 0. How the function calculates when signalperiod = 1? Why the function can accept signalperiod = 1?

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub, or unsubscribe.

mrjbq7 avatar Aug 12 '20 03:08 mrjbq7

signalperiod = 1 appears to be a valid value according to the code that I found in input validation part of the code...below. I guess I have a similar question, when you have some time, as to why this is a valid input and the meaning of the functions output.

many thanks

/* Generated / else if( ((int)optInSignalPeriod < 1) || ((int)optInSignalPeriod > 100000) ) / Generated */ return -1;

zlac116 avatar Aug 27 '20 15:08 zlac116