Conversation
removed max=100 as it overwrites the max value when calling GetPriceHistory
|
Thanks for looking into that! I guess we can remove the |
markusvanlaak
left a comment
There was a problem hiding this comment.
Added some comments. Regards
| @@ -537,7 +537,7 @@ func (ig *IGMarkets) GetPriceHistory(epic, resolution string, max int, from, to | |||
| limitStr = fmt.Sprintf("&max=%d", max) | |||
There was a problem hiding this comment.
max is set only when "to" or "from" has no time.Time value.
GetPriceHistory requires time.Time so it will never set "max" in the "else if" to 1.
Setting max is required to not get the default of i think 10.
There was a problem hiding this comment.
What I mean is: If max > 0, we set max twice. In page and in limitStr. This is wrong IMO because both are used to assemble the URL. I think we need to removed it from page and leave limitStr empty if max is zero.
sklinkert
left a comment
There was a problem hiding this comment.
Looks better :-) Can we please remove fmt.Println() as it was used for debugging (I guess)?
removed max=100 as it overwrites the max value when calling GetPriceHistory