{"action":"closed","issue":{"url":"https://api.github.com/repos/JuliaQuant/MarketTechnicals.jl/issues/21","labels_url":"https://api.github.com/repos/JuliaQuant/MarketTechnicals.jl/issues/21/labels{/name}","comments_url":"https://api.github.com/repos/JuliaQuant/MarketTechnicals.jl/issues/21/comments","events_url":"https://api.github.com/repos/JuliaQuant/MarketTechnicals.jl/issues/21/events","html_url":"https://github.com/JuliaQuant/MarketTechnicals.jl/issues/21","id":29613567,"number":21,"title":"length of output should stay the same as the input","user":{"login":"LeoK987","id":6257601,"avatar_url":"https://avatars.githubusercontent.com/u/6257601?v=3","gravatar_id":"","url":"https://api.github.com/users/LeoK987","html_url":"https://github.com/LeoK987","followers_url":"https://api.github.com/users/LeoK987/followers","following_url":"https://api.github.com/users/LeoK987/following{/other_user}","gists_url":"https://api.github.com/users/LeoK987/gists{/gist_id}","starred_url":"https://api.github.com/users/LeoK987/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/LeoK987/subscriptions","organizations_url":"https://api.github.com/users/LeoK987/orgs","repos_url":"https://api.github.com/users/LeoK987/repos","events_url":"https://api.github.com/users/LeoK987/events{/privacy}","received_events_url":"https://api.github.com/users/LeoK987/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":5,"created_at":"2014-03-18T01:22:08Z","updated_at":"2015-03-12T13:44:45Z","closed_at":"2015-03-12T13:44:45Z","body":"I see that the current output from functions like sma is of length N-n+1, where N is the original length of the timeseries. While that is reasonable, it is practically inconvenient. For further calculation between the output timeseries and the original timeseries, the end user may have to spend extra effort dealing with syncing and the omitted values.\r\n\r\nI suggest that these functions keep the original length. As to the values at those indexes whose function values are not specifically defined, we can adopt one of three ways: 1) set them to NaN, 2) set them to 0, or more preferably 3), set them to a more meaningful value. In the case of sma, the more meaningful value in method 3) can be the average of the available values up to the index under calculation. For instance, when calculating a 10-bar sma, at index 3, the sma can be (v[1] + v[2] + v[3])/3."}}