herbsun / okklineswift Goto Github PK
View Code? Open in Web Editor NEWDraw the K-Line by Swift, support iOS & macOS
License: MIT License
Draw the K-Line by Swift, support iOS & macOS
License: MIT License
模拟器,iPhone 6s, iOS10.1(14B72)。点击MA与BOLL之间的EMA按钮时,程序崩溃在OKKLineMainView.swift(Line 303)。
堆栈信息:2016-12-31 16:07:12.425559 OKKLineSwift-iOS-Demo[2299:154750] [] nw_socket_set_common_sockopts setsockopt SO_NOAPNFALLBK failed: [42] Protocol not available, dumping backtrace:
[x86_64] libnetcore-856.20.4
0 libsystem_network.dylib 0x000000011149c682 __nw_create_backtrace_string + 123
1 libnetwork.dylib 0x0000000111779932 nw_socket_add_input_handler + 3100
2 libnetwork.dylib 0x00000001117574f4 nw_endpoint_flow_attach_protocols + 3768
3 libnetwork.dylib 0x0000000111756511 nw_endpoint_flow_setup_socket + 563
4 libnetwork.dylib 0x0000000111755270 -[NWConcrete_nw_endpoint_flow startWithHandler:] + 2612
5 libnetwork.dylib 0x000000011177044d nw_endpoint_handler_path_change + 1261
6 libnetwork.dylib 0x000000011176fe7c nw_endpoint_handler_start + 570
7 libnetwork.dylib 0x0000000111787ae5 nw_endpoint_resolver_start_next_child + 2240
8 libdispatch.dylib 0x0000000111219980 _dispatch_call_block_and_release + 12
9 libdispatch.dylib 0x00000001112430cd _dispatch_client_callout + 8
10 libdispatch.dylib 0x0000000111220e6b _dispatch_queue_serial_drain + 236
11 libdispatch.dylib 0x0000000111221b9f _dispatch_queue_invoke + 1073
12 libdispatch.dylib 0x00000001112243b7 _dispatch_root_queue_drain + 720
13 libdispatch.dylib 0x000000011122408b _dispatch_worker_thread3 + 123
14 libsystem_pthread.dylib 0x00000001115ec4de _pthread_wqthread + 1129
15 libsystem_pthread.dylib 0x00000001115ea341 start_wqthread + 13
POST https://www.btc123.com/kline/klineapi?size=300&symbol=okcoincnbtccny&type=5min 200
fatal error: Index out of range
看了你的iOS Demo ,默认是加载300条数据,如果我还要看以前的历史数据,你这套组件可以支持这个功能吗?
日BOLL指标计算为例,
其计算方法如下:
1.日BOLL指标的计算公式
中轨线=N日的移动平均线
上轨线=中轨线+两倍的标准差
下轨线=中轨线-两倍的标准差
2.日BOLL指标的计算过程
(1)计算MA MA=N日内的收盘价之和÷N
(2)计算标准差MD MD=平方根N日的(C-MA)的两次方之和除以N
(3)计算MB、UP、DN线
MB=(N-1)日的MA
UP=MB+2×MD
DN=MB-2×MD
伪代码如下:
中轨:MB=SMA(n-1)=(C1+C2+C3+…+C(n-1))/(n-1))
标准差:MD ={[(C1-SMAn)^2+…+(Cn-SMAn)^2]/n}^0.5
上轨:UP=MB + kMD
下轨:DN=MB - KMD
根据上面的公式,你的标准差的计算明显有问题。
"des"
- value : 交易所不存在
看了你的iOS Demo ,默认是加载300条数据,如果我还要看以前的历史数据,你这套组件可以支持这个功能吗?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.