#c_lang#ctp#ctpapi#futures#options#quant#simnow#stock#tora#trader#tts#xtp
openctp is a powerful open-source trading platform compatible with many Chinese securities and futures trading systems, offering both real and simulated trading environments for futures, options, stocks, funds, and bonds across domestic and global markets like A-shares, Hong Kong, and US stocks. It provides easy access to CTPAPI through Python and other programming languages, plus user-friendly trading clients with graphical and command-line interfaces. You can register free simulation accounts instantly via WeChat, enabling you to practice and test trading strategies in real-time or 24/7 environments. It also offers training, development support, and a monitoring platform for multiple trading systems, helping you learn, develop, and trade efficiently with low costs and broad market access. This benefits you by giving a flexible, comprehensive, and cost-effective way to develop, test, and execute trading strategies across many markets with strong community and technical support.
https://github.com/openctp/openctp
🚀 Вышел стабильный JavaScript движок от Google для Android
Новая стабильная библиотека Jetpack JavaScript Engine позволит разработчикам выполнять JS код в изолированной и ограниченной среде.
class MainActivity : ComponentActivity() {
// Теперь nullable, без lateinit
private var jsSandbox: JavaScriptSandbox? = null
private var jsIsolate: JavaScriptIsolate? = null
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
if (!JavaScriptSandbox.isSupported()) {
Log.e("JS", "JavaScriptSandbox не поддерживается")
return
}
lifecycleScope.launch {
// Создаём и сохраняем в nullable-поле
jsSandbox = JavaScriptSandbox
.createConnectedInstanceAsync(applicationContext)
.await()
jsIsolate = jsSandbox?.createIsolate()
// При выполнении гарантируем, что jsIsolate != null
val result: String = jsIsolate
?.evaluateJavaScriptAsync(JS_SCRIPT_SCRING)
?.await()
?: "Ошибка: isolate не инициализирован"
Log.d("JS", "Результат выполнения: $result")
}
}
override fun onDestroy() {
super.onDestroy()
// Закрываем только если не null
jsIsolate?.close()
jsSandbox?.close()
}
}
#jetpack#js