0
Follow
2
Followers
Wenn ich die Schräglage berechne, sieht die Schräglage auf der Grafik glatt aus, aber wenn ich die Koordinatenachsen berechne, ist die Schräglage zu groß, weil x zu klein ist.
Wie haben Sie das Problem gelöst?
def-Winkel (v1):
bx = 3502 -3516
by = 4
angle1 = math.atan2(bx, by)
print(angle1)
angle1 = int(angle1 * 180/math.pi)
print(angle1)
Das ist die Abweichung von 14 Punkten, die Steigung und der Winkel sind sehr groß.
-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


