0
Follow
2
Followers
我算斜率的时候,明明ema在图表上看起来很平滑,但是用坐标轴算因为x太小导致算出来值很大。
各位大佬是怎么解决这个问题的。
def 角度(v1):
bx = 3502 -3516
by = 4
angle1 = math.atan2(bx, by)
print(angle1)
angle1 = int(angle1 * 180/math.pi)
print(angle1)
就这样14点的差距,斜率和角度非常大
-1.2924966677897853
-74
Related Recommendations
Financial Magic Zone Global KOL RecruitmentFAQ Summary (Updating...)PINE Language Introductory Tutorial of FMZ QuantPrimary Tutorial of Strategy Writing with FMZ Quant Trading Platform (Must Read)Getting Started with FMZ Quant Trading Platform (Must Read)MyLanguage DocFMZ PINE Script DocNotes & Explanation of Futures Reverse Doubling Algorithm StrategySolutions to Obtaining Docker Http Request MessageExtending Custom Template by Visual (Blockly ) Strategy Editing
Comment
All comments (12)
def 角度(v1,取长):
r = _C(exchange.GetRecords)
数据长度 = len(v1)
数据长度 = int(数据长度-1)
取长 = int(取长)
dx1 = v1[数据长度]
dy1 = 数据长度 + 1
dx2 = v1[数据长度-取长]
while dx2 is None:
取长=取长 - 1
dx2 = v1[数据长度-取长]
dy2 = 数据长度 - 取长
bx = dx1 -dx2
#by = dy1 -dy2
by = zhou*2
angle1 = math.atan2(bx, by)
angle1 = int(angle1 * 90/math.pi)
return angle1
4 years ago
- 1


