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

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

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
Signal
Bollinger
This cBot uses a combination of Heikin Ashi and Bollinger Bands strategies.
cBot
Volume
Imbalance
+3
VOLUME IMBALANCE STRIP A focused multi-timeframe imbalance visualization tool for cTrader.
cBot
AI Trading
Intelligent Automated Trading (Gold, Forex, commodities)
1.97
プロフィットファクター
cBot
Key Levels
SL Manager
+4
RISK REWARD VISUALIZER Part of the MACRO ZERO Suite Visualize your active positions, pending orders, and cl
cBot
// XAU/USD 1H TIMEFRAME // 5 YEARS BACKTEST, PROFIT 2100 USD, DRAWDOWN MAX 195 USD 
cBot
AI
Forex
+1
35% ROI in 30 days on EUR/USD with controlled risk.Gradient Pro Machine Learning
cBot
DreamProfitFXBot hunts pips daily with precision, filters out noise, and locks profits fast. Built for sharp day-traders
cBot
AI
ATR
+9
Gold Predict AI – Advanced Predictive Trading for XAUUSD (M15)
cBot
GBPUSD
Indices
fixed bug
cBot
Conservative
Grid Recovery
Ziggy, an advanced algorithm designed to maximize efficiency and simplify profit control.
cBot
Forex
GBPUSD
+2
GoldenPharaoh_2 Trial Day 15
cBot
Prop
Forex
+4
cBot designed to assist traders in managing position risk effectively.
cBot
AI
Forex
+4
Trend Following Strategy with adjustment Risk Management PLEASE ENJOY!!
10.9%
ROI
3.2
プロフィットファクター
cBot
XAUUSD
Bollinger
+1
Sfrutta il breakout delle bande di bollinger.
cBot
Prop
Forex
+11
Risk On Trade Lite | Auto Position Size Calculator for cTrader | Risk & Reward Tool | Auto Lot Size Calculator
cBot
AI
ATR
+13
Multi-indicator scalping bot with concurrent trade management, and adaptive risk controls for professional forex trading
cBot
AI
Grid
+4
Institutional-Grade AI for Retail Traders,Trade Like a Central Bank.
cBot
Prop
Forex
+5
Close 50%, 80% or Custom % , Close Full position and Move Stop to Breakeven buttons plus a floating Profit/loss counter
登録日 18/12/2024
2
販売
4.16K
無料インストール