3

PHP Trader Function: trader_sma, when it asks for time period, what type of period is it asking ? Days, Seconds, etc?

Regarding: array trader_sma ( array $real [, integer $timePeriod ] )

Any insight regarding this function would be very appreciated. The trader functions are highly undocumented. If you know of any documentation, let me know about it please.

Sven Kahn
  • 487
  • 1
  • 3
  • 16

1 Answers1

1

It's not asking for a type of period; it's asking how many periods to use in calculating the simple moving average.

elixenide
  • 44,308
  • 16
  • 74
  • 100
  • Yes, I understood that it wasn't asking for you to define the type (i.e.; day/hour/second), I just wasn't sure what the time period represented....but basically from what you're saying, a time period of 2==2 trading days? Sorry, just want to be sure. – Sven Kahn Jan 10 '15 at 20:29
  • It's whatever you pass in the array, as I understand it. If you pass it daily data, you get a daily MA. Pass it hourly data, you get an hourly MA, etc. – elixenide Jan 10 '15 at 21:00
  • Yes that makes sense, thank you. I just don't know why they included the time period param...but you answered my question, I appreciate your time. – Sven Kahn Jan 10 '15 at 23:00
  • 1
    For anybody that stumbles upon this question: Time Period represents days of trading (Valid range from 2 to 100000). – Sven Kahn Jan 11 '15 at 03:21