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

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

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;
                }
            }
        }
    }
}

取引プロフィール
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
AI
ATR
+8
AI Trading that you can adjust to your own strategy, this AI will do a work for you, Adjust to suit your own strategy
cBot
MACD
Signal
+3
Dominate gold markets with Supertrend Gold – Backtested with +962% ROI!
cBot
Forex
Crypto
+2
EMA Crossover Advanced Bot Smart Trend Trading Robot for cTrader with Daily Confirmation & USD Trailing Stop
cBot
Conservative
Grid Recovery
Ziggy, an advanced algorithm designed to maximize efficiency and simplify profit control.
cBot
AI
ATR
+12
The Perfect AI Algorithm Bot you have ever seen, Please ENJOY!!
9.8%
ROI
3.6
プロフィットファクター
cBot
ATR
Aggressive
+5
FREE backtest-only. Reproduce Pegasus Nasdaq's +215.92% in your own cTrader - no grid, no martingale. REAL EDGE
1.69
プロフィットファクター
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
ATR
RSI
+15
SwissArmyKnife DEMO version
cBot
Volume
Balanced
+5
An automated utility featuring global drawdown control, basket trailing profit tracking, and custom session filters.
16.4%
ROI
1.55
プロフィットファクター
cBot
Grid
Crypto
+5
this is private product.
10.2%
ROI
1.8
プロフィットファクター
cBot
Forex
BTCUSD
+7
Fully functional demo runs until January 31, 2026 with over 100% ROI within 14 days
cBot
Perfectly optimized to trade AUDUSD. Over 85% win rate
cBot
Prop
Forex
+11
A Fintech-Engineered Investment Opportunity in Algorithmic Gold Trading
cBot
EURUSD
EURUSD M1 free Backtest until 16.01.2025
cBot
SMC
Prop
+12
Risk On Trade | Auto Position Size Calculator | Risk & Reward Tool | Auto Lot Size Calculator
cBot
Forex
BTCUSD
+4
OneClick SL/TP Setter — Smart Trade Management Made Simple
cBot
AI Trading
Drawdown Guard
+2
Intelligent Automated Trading (Gold, Forex, commodities)
1.97
プロフィットファクター
cBot
Prop
Forex
+2
Lock your risk before you click Buy or Sell. Entering a trade without clearly defined risk!
登録日 18/12/2024
2
販売
4.17K
無料インストール