New to asking questions about MA functions

Author: cappuccinnoo, Created: 2018-01-22 14:50:27, Updated:

I'm going to use the TA.MA function to take MA5 from a 15-minute K-string graph. However, in the real world, the log-out MA is significantly different from the exchange's K chart. So who's going to see if my function works?

var records = exchange.GetRecords(PERIOD_M15); 
var ma = TA.MA(records, 5);
ma = ma[ma.length - 1]
Log('5日均线', ma)

More

The Little DreamFirst things first: make sure that the time cycle is the same as the one you're comparing, the same 15 minutes, if it's a futures, be careful whether it's the same contract, and also be careful whether the cycle choice is all 5, i.e. the average value line of 5 cycles. Secondly, the last bar of the K-line is real-time variable, so the last value of the indicator line is also real-time variable. Finally, if you are testing differently, you can look at the chart, I will help you analyze, the chart shows the name of the test object, the time period, etc.

The Little DreamIt should be code writing problems, interactive code. This is the first time I've seen a bot. There is a complete interactive code, examples, and use cases.

cappuccinnooThanks, I've now focused on the problem further. It's okay if the variable changes the assignment directly in the main, but if the variable changes the assignment by interacting with the hash policy, it seems like the result is not ideal. For example, DELAY is the default 30, and I changed it to 60, but it still executes 30.