E7 BBKG NumSharp Sample
cBot
257 ダウンロード数
バージョン 1.0、Feb 2025
Windows、Mac, Mobile, Web
Trading product for E7 BBKG NumSharp Sample cBot AI, image 2
登録日 18/12/2024
2
販売
4.24K
無料インストール

説明

多くの方からのご要望により、現在、当社の機械学習コードやパッケージのいくつかの例を提供するために懸命に取り組んでいます。

TensorFlow、PyTorch、Keras、Numpy、Pandas、そして多くの.NETパッケージをcTrader内で利用開始できます。

私たちの使命は、cTrader内での機械学習を誰にとってもより簡単にすることです。

ハッピー・ハンティング!

*** このコードは何も取引しません(データを出力するだけです)。これは、当社の機械学習パッケージを使用して独自のAIモデルを作成し始める方法のサンプルコードに過ぎません。

.......................................................

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using cAlgo.API;
using cAlgo.API.Collections;
using cAlgo.API.Indicators;
using cAlgo.API.Internals;

using NumSharp;
using np = NumSharp.np;
using Shape = NumSharp.Shape;

using PandasNet;
using static PandasNet.PandasApi;

namespace cAlgo.Robots
{
    [Robot(TimeZone = TimeZones.UTC, AccessRights = AccessRights.None)]
    public class E7BBKGNumSharpSample : Robot
    {
        [Parameter("Version 1.01", DefaultValue = "Version 1.01")]
        public string Version { get; set; }

        [Parameter("Source")]
        public DataSeries Source { get; set; }

        [Parameter("Bars Required", DefaultValue = 50, MinValue = 1, MaxValue = 10000, Step = 1)]
        public int BarsRequired { get; set; }

        [Parameter("Method Name", DefaultValue = MethodName.DataSplitPrints)]
        public MethodName Mode { get; set; }
        public enum MethodName
        {
            DataSplitPrints,
            PandasPrints,
            NDArrayPrints
        }
        
        protected override void OnStart()
        {
            // インジケーターを初期化します
        }

        protected override void OnBar()
        {
            try
            {
                if (Mode == MethodName.DataSplitPrints)
                {
                    DataSplitPrints();
                }
                else if (Mode == MethodName.PandasPrints)
                {
                    PandasPrints();
                }
                else if (Mode == MethodName.NDArrayPrints)
                {
                    NDArrayPrints();
                }
            }
            catch (Exception ex)
            {
                Print($"エラー: {ex.Message}");
                if (ex.InnerException != null)
                {
                    Print($"内部例外: {ex.InnerException.Message}");
                    throw;
                }
            }
        }

        private float[,] GetDataSet()
        {
            int startBar = Bars.ClosePrices.Count - BarsRequired;
            float[,] inputSignals = new float[BarsRequired, 5];

            for (int i = 0; i < BarsRequired; i++)
            {
                int barIndex = startBar + i;
                inputSignals[i, 0] = (float)Bars.OpenPrices[barIndex];
                inputSignals[i, 1] = (float)Bars.HighPrices[barIndex];
                inputSignals[i, 2] = (float)Bars.LowPrices[barIndex];
                inputSignals[i, 3] = (float)Bars.ClosePrices[barIndex];
                inputSignals[i, 4] = (float)Bars.TickVolumes[barIndex];
            }
            return inputSignals;
        }
        
        private float[,] GetTargetDataSet()
        {
            int startBar = Bars.ClosePrices.Count - BarsRequired;
            float[,] inputSignals = new float[BarsRequired, 5];

            for (int i = 0; i < BarsRequired; i++)
            {
                int barIndex = startBar + i;
                inputSignals[i, 0] = (float)Bars.OpenPrices[barIndex];
                inputSignals[i, 1] = (float)Bars.HighPrices[barIndex];
                inputSignals[i, 2] = (float)Bars.LowPrices[barIndex];
                inputSignals[i, 3] = (float)Bars.ClosePrices[barIndex];
                inputSignals[i, 4] = (float)Bars.TickVolumes[barIndex];
            }
            return inputSignals;
        }
        
        /// NumSharp データ分割プリント
        public void DataSplitPrints()
        {
            // モデルの期待する入力形状に合わせて入力データをリシェイプ
            //var inputShape = new Shape(-1, BarsRequired, 5);
            NDArray inputData = np.array<float>(GetDataSet());
            Print("入力NDarray: " + string.Join(", ", inputData));
            
            // モデルが期待するターゲット形状に合わせてターゲットデータをリシェイプ
            //var targetShape = new Shape(-1, 5);
            NDArray targetData = np.array<float>(GetTargetDataSet());
            Print("ターゲットNDarray: " + string.Join(", ", targetData));
            
            // データをトレーニングセットとテストセットに分割
            int testSize = (int)(0.2 * inputData.shape[0]); // テスト用に20%
            var (x_train, x_test) = (inputData[$":{inputData.shape[0] - testSize}"], inputData[$"{inputData.shape[0] - testSize}:"]);
            var (y_train, y_test) = (targetData[$":{targetData.shape[0] - testSize}"], targetData[$"{targetData.shape[0] - testSize}:"]);
            
            Print("X_train データ: " + string.Join(", ", x_train));
            Print("X_test データ: " + string.Join(", ", x_test));
            Print("Y_train データ: " + string.Join(", ", y_train));
            Print("Y_test データ: " + string.Join(", ", y_test));
        }
        
        /// PandasNet プリント
        public void PandasPrints()
        {
            // float[,] を List<Series> に変換
            var inputData = GetDataSet();
            var targetData = GetTargetDataSet();
            
            var inputSeriesList = new List<Series>();
            var targetSeriesList = new List<Series>();
            
            for (int col = 0; col < inputData.GetLength(1); col++)
            {
                List<float> columnData = new List<float>();
                for (int row = 0; row < inputData.GetLength(0); row++)
                {
                    columnData.Add(inputData[row, col]);
                }
                inputSeriesList.Add(new Series(columnData.ToArray()));
            }
            
            for (int col = 0; col < targetData.GetLength(1); col++)
            {
                List<float> columnData = new List<float>();
                for (int row = 0; row < targetData.GetLength(0); row++)
                {
                    columnData.Add(targetData[row, col]);
                }
                targetSeriesList.Add(new Series(columnData.ToArray()));
            }
            // DataFrameを作成
            DataFrame inputDataFrame = new DataFrame(inputSeriesList);
            DataFrame targetDataFrame = new DataFrame(targetSeriesList);
            
            Print("入力DataFrame: " + inputDataFrame);
            Print("ターゲットDataFrame: " + targetDataFrame);
            
            //Print("Input DataFrame: " + string.Join(", ", inputDataFrame));
            //Print("Target DataFrame: " + string.Join(", ", targetDataFrame));
        }
        
        /// シンプルなNumSharp NDArraysプリント
        public void NDArrayPrints()
        {
            if (Bars.ClosePrices.Count < BarsRequired)
                return;

            try
            {
                // 入力データ float[,] を呼び出す
                float[,] inputData = GetDataSet();

                // NDArrayに変換し (BarsRequired, 5) にリシェイプ
                NDArray inputNDArray = np.array(inputData);   // NumSharp
                Print("入力NumSharp NDarrayデータ : " + string.Join(", ", inputNDArray));
                Print("入力NumSharp NDarray形状: " + string.Join(", ", inputNDArray.shape));
                
                int expectedLength = BarsRequired * 5;
                Print($"期待されるNumSharp NDarrayの長さ: {expectedLength}");
                Print($"入力NumSharp NDarrayのサイズ: {inputNDArray.size}");

                if (inputNDArray.size != expectedLength)
                {
                    Print($"長さ不一致: 期待長さ {expectedLength}、しかしサイズは {inputNDArray.size} でした");
                    return;
                }
            }
            catch (Exception ex)
            {
                Print("例外: " + ex.Message);
                Print("スタックトレース: " + ex.StackTrace);

                Exception innerException = ex.InnerException;
                while (innerException != null)
                {
                    Print("内部例外: " + innerException.Message);
                    Print("内部例外スタックトレース: " + innerException.StackTrace);
                    innerException = innerException.InnerException;
                }
            }
        }
    }
}

概要

AIによる概要
E7 BBKG NumSharp Sample is a cTrader robot providing sample code to demonstrate integration of machine learning libraries within the cTrader environment. It includes examples using .NET packages such as TensorFlow, PyTorch, Keras, NumSharp, and PandasNet. The robot does not execute trades but prints out processed data to illustrate how users can start building AI models for trading analysis.
Key functionalities include:
- Data extraction from market bars (open, high, low, close prices, and tick volumes) over a configurable number of bars.
- Conversion of this data into formats compatible with machine learning workflows, including NumSharp NDArrays and Pandas DataFrames.
- Methods to split data into training and testing sets, and to print these datasets for inspection.
- Three operational modes selectable via parameters: DataSplitPrints, PandasPrints, and NDArrayPrints, each demonstrating different data handling approaches.
This sample code aims to facilitate machine learning development inside cTrader by providing foundational examples of data preparation and manipulation using popular ML libraries in a .NET context.
取引プロフィール

カスタマーレビュー

0.0
レビュー: 0
カスタマーレビュー
この商品にはまだレビューがありません。お使いになったことがある方は、ぜひレビューをお願いします。

ディスカッション

よくあるご質問

AI
cTrader Storeで入手可能な取引ボット、インジケーター、プラグインなどの商品は、第三者の開発者が提供するものであり、情報と技術の取得のみを目的としてご利用いただけます。cTrader Storeはブローカーではなく、投資助言や個人的な推奨を行うことも、将来のパフォーマンスを保証することもありません。

この作成者の他の商品

インジケーター
E7 Volume Profile, more modern look and feel.
インジケーター
Prop
E7 BBKG indicator with 80% plus accuracy used to show both, possible reversal and trend.
インジケーター
Polynomial Regression Channel which also reflects the volatility of the underlying asset.
インジケーター
E7 Harmonic Structures Basic.
インジケーター
E7 Correlation Dashboard.
インジケーター
Bollinger
Bollinger Band Cloud, Heiken Ashi, Trend Follower and Parabolic SAR.
インジケーター
Indices
Option pricing using the BlackScholes model and the Math.Numerics packages
インジケーター
Bollinger
ADXR, KDJ, SineWave, Bollinger Band Volatility and AEOscillator.
インジケーター
cTrader ID

これも好きかも

cBot
Conservative
Grid Recovery
Ziggy, an advanced algorithm designed to maximize efficiency and simplify profit control.
cBot
AI
ATR
+15
SuperTrend X cBot is a fully automated trading robot for cTrader built entirely on the power of the SuperTrend indicator
cBot
ATR
EMA
+5
Momentum driven, Compounding. Volatility adaptive EMA BOLLINGER ATR base Strategy
93.4%
ROI
1.31
プロフィットファクター
cBot
BTCUSD
Automated cTrader bot with webhook support, trade management, take-profit levels, and Telegram notifications
cBot
Forex
Most Profitable cAlgo cBot cTrader 2024 for GBPUSD Reach 443450% Net Profit
cBot
AI
RSI
+5
H1 and L1 BOT — Pure Price Action Automation - NEW VERSION IN PROGRESS...
1.52
プロフィットファクター
cBot
Break Even
Risk/Reward
+5
Automatic position sizing, smart pending orders, loss limits, and one-click trade execution for cTrader.
cBot
CHOCH
SL Manager
+1
Trade with clarity. Protect your capital. Let Risk Manager enforce the rules.
cBot
// EUR/USD 4H TIMEFRAME // 5 YEARS BACKTEST, PROFIT 176 USD, MAX DRAWDOWN 55 USD
cBot
RSI
Indices
SALE OFF!!! this innovative bot combines the precision of Fibonacci Retracement, EMA and RSI...
cBot
Prop
Forex
+11
Risk On Trade Lite | Auto Position Size Calculator for cTrader | Risk & Reward Tool | Auto Lot Size Calculator
cBot
ATR
Forex
+2
Auto-Breakeven Bot w/ ATR & dual triggers. Works 100% with Risk Reward Guardian. Was Free for early users now -80%
cBot
Fixed Lot
VPS Recommended
+3
A high-performance cTrader local trade copier . Copy positions and pending orders between multiple terminals instantly.
cBot
AI
ATR
+27
The Prop-Ready Bot The Definitive Automaton for Challenges 🛡️ V2.0
cBot
Signal
Supertrend
Bot is based on Price Action strategy to open & manage orders. It is effective capital management and high profitability
cBot
Pulse Tick Reactor: AI-powered trading bot delivering precision entries, adaptive risk control, and consistent profits.
cBot
ATR
SL Manager
+3
Este cBot está diseñado para operar rupturas de rango en BTCUSD con una logica simple
49.6%
ROI
1.44
プロフィットファクター
cBot
Forex
Crypto
+4
Creates buy limit orders automatically when the market drops.

価格

登録日 18/12/2024
2
販売
4.24K
無料インストール