E7 BBKG NumSharp Sample
cBot
262 unduhan
Versi 1.0, Feb 2025
Windows, Mac, Mobile, Web
Trading product for E7 BBKG NumSharp Sample cBot AI, image 2
Sejak 18/12/2024
2
Penjualan
4.26K
Instal gratis

Deskripsi

Seperti yang diminta oleh banyak dari Anda, kami sekarang bekerja keras untuk menyediakan contoh beberapa kode dan paket pembelajaran mesin kami.

TensorFlow, PyTorch, Keras, Numpy, Pandas dan banyak paket .NET lainnya untuk memulai di dalam cTrader.

Misi kami adalah membuat Pembelajaran Mesin di dalam cTrader menjadi lebih mudah untuk semua orang.

Selamat berburu!

*** Kode ini tidak melakukan perdagangan apapun (hanya mencetak data dll). Ini hanyalah contoh kode bagaimana Anda dapat mulai membuat model AI Anda sendiri menggunakan paket Pembelajaran Mesin kami.

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

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("Versi 1.01", DefaultValue = "Versi 1.01")]
        public string Version { get; set; }

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

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

        [Parameter("Nama Metode", DefaultValue = MethodName.DataSplitPrints)]
        public MethodName Mode { get; set; }
        public enum MethodName
        {
            DataSplitPrints,
            PandasPrints,
            NDArrayPrints
        }
        
        protected override void OnStart()
        {
            // Inisialisasi indikator apapun
        }

        protected override void OnBar()
        {
            coba
            {
                jika (Mode == MethodName.DataSplitPrints)
                {
                    DataSplitPrints();
                }
                lain jika (Mode == MethodName.PandasPrints)
                {
                    PandasPrints();
                }
                lain jika (Mode == MethodName.NDArrayPrints)
                {
                    NDArrayPrints();
                }
            }
            tangkap (Exception ex)
            {
                Print($"Kesalahan: {ex.Message}");
                jika (ex.InnerException != null)
                {
                    Print($"Inner Exception: {ex.InnerException.Message}");
                    lempar;
                }
            }
        }

        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;
        }
        
        /// Cetakan Pembagian Data NumSharp
        public void DataSplitPrints()
        {
            // Mengubah bentuk data input agar sesuai dengan bentuk input yang diharapkan model
            //var inputShape = new Shape(-1, BarsRequired, 5);
            NDArray inputData = np.array<float>(GetDataSet());
            Print("Input NDarray: " + string.Join(", ", inputData));
            
            // Mengubah bentuk data target agar sesuai dengan bentuk target yang diharapkan model
            //var targetShape = new Shape(-1, 5);
            NDArray targetData = np.array<float>(GetTargetDataSet());
            Print("Target NDarray: " + string.Join(", ", targetData));
            
            // Membagi data menjadi set pelatihan dan pengujian
            int testSize = (int)(0.2 * inputData.shape[0]); // 20% untuk pengujian
            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("Data X_train: " + string.Join(", ", x_train));
            Print("Data X_test: " + string.Join(", ", x_test));
            Print("Data Y_train: " + string.Join(", ", y_train));
            Print("Data Y_test: " + string.Join(", ", y_test));
        }
        
        /// Cetakan PandasNet
        public void PandasPrints()
        {
            // Mengonversi float[,] ke 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()));
            }
            
            // Membuat DataFrame
            DataFrame inputDataFrame = new DataFrame(inputSeriesList);
            DataFrame targetDataFrame = new DataFrame(targetSeriesList);
            
            Print("DataFrame Input: " + inputDataFrame);
            Print("DataFrame Target: " + targetDataFrame);
            
            //Print("DataFrame Input: " + string.Join(", ", inputDataFrame));
            //Print("DataFrame Target: " + string.Join(", ", targetDataFrame));
        }
        
        /// Cetakan NDArrays NumSharp Sederhana
        public void NDArrayPrints()
        {
            jika (Bars.ClosePrices.Count < BarsRequired)
                kembali;

            coba
            {
                // Memanggil Data Input float[,] Anda
                float[,] inputData = GetDataSet();

                // Mengonversi ke NDArray dan mengubah bentuk menjadi (BarsRequired, 5)
                NDArray inputNDArray = np.array(inputData);   // NumSharp
                Print("Data NumSharp NDarray Input : " + string.Join(", ", inputNDArray));
                Print("Bentuk NumSharp NDarray Input: " + string.Join(", ", inputNDArray.shape));
                
                int expectedLength = BarsRequired * 5;
                Print($"Panjang NumSharp NDarray yang Diharapkan: {expectedLength}");
                Print($"Ukuran NumSharp NDarray Input: {inputNDArray.size}");

                jika (inputNDArray.size != expectedLength)
                {
                    Print($"Ketidaksesuaian Panjang: Panjang yang Diharapkan {expectedLength}, tetapi mendapatkan Ukuran {inputNDArray.size}");
                    kembali;
                }
            }
            tangkap (Exception ex)
            {
                Print("Exception: " + ex.Message);
                Print("StackTrace: " + ex.StackTrace);

                Exception innerException = ex.InnerException;
                while (innerException != null)
                {
                    Print("Inner Exception: " + innerException.Message);
                    Print("Inner Exception StackTrace: " + innerException.StackTrace);
                    innerException = innerException.InnerException;
                }
            }
        }
    }
}

Ringkasan

Ringkasan 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.
Profil trading

Ulasan pelanggan

0.0
Ulasan: 0
Ulasan pelanggan
Belum ada ulasan untuk produk ini. Sudah mencobanya? Jadilah pemberi ulasan pertama!

Diskusi

Pertanyaan umum

AI
Produk-produk yang tersedia melalui cTrader Store, termasuk bot trading, indikator, dan plugin, disediakan oleh pengembang pihak ketiga serta hanya ditujukan untuk akses teknis dan informasi. cTrader Store bukan broker dan tidak menyediakan saran investasi, rekomendasi pribadi, atau jaminan apa pun tentang kinerja di masa mendatang.

Produk lain dari penulis ini

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

Anda mungkin juga suka

cBot
Fixed Risk %
Risk/Reward
+5
One-click fixed-risk execution with a built-in daily loss guard. Made for manual traders and prop challenges.
0.01
Faktor laba
cBot
Conservative
Grid Recovery
Ziggy, an advanced algorithm designed to maximize efficiency and simplify profit control.
cBot
Prop Firm Fit
One-click Trading
+3
Watches your equity in real time and blocks new trades the moment you're near your daily or max loss limit.
cBot
Grid Recovery
TheBestBotForXAUUSDSuperProfits DEMO
19.6%
ROI
50
Faktor laba
cBot
Signal
Bollinger
This cBot uses a combination of Heikin Ashi and Bollinger Bands strategies.
cBot
Forex
EURUSD
+2
Amazing Gold Quantum TRIAL DAY 15
cBot
Prop
Forex
+11
Risk On Trade Lite | Auto Position Size Calculator for cTrader | Risk & Reward Tool | Auto Lot Size Calculator
cBot
AI
Stocks
+1
Advanced Automated SPX Algorithmic Trading System
4
Faktor laba
cBot
ATR
RSI
+4
UltimateAI Trading Robot – Smart Trend & Momentum Trader for cTrader
cBot
AI
ATR
+27
Review and User Guide: PROP Account Guardian Pro cBot 🛡️
cBot
Forex
Crypto
+2
EMA Crossover Advanced Bot Smart Trend Trading Robot for cTrader with Daily Confirmation & USD Trailing Stop
cBot
RSI
Forex
+3
Wealthcraft Auto Profit is a smart trading robot with Auto Stop-Loss, Trailing Stop, and maximum profit management
cBot
Fibonacci
Fixed Lot
+5
Trading dashboard for fast order execution, position management, risk controls and automatic Fibonacci levels.
1.52
Faktor laba
cBot
Key Levels
Spread Filter
+3
MATRIX INFINITY, See Beyond the Market.
22.3%
ROI
31
Faktor laba
cBot
Forex
Crypto
+2
The cTrader Risk & Reward management tool can easily help you to set the risk vs reward values
cBot
AI
RSI
+2
HannibalScalpLiteAI – A reliable scalping bot for EUR/USD (M1) using EMA, RSI, and COG indicators. Designed for simplici
cBot
SMC
Forex
+11
💎 ICT Silver Bullet Strategy cBot — liquidity sweep & breakout algorithm with risk control.
cBot
AI
Grid
+5
AI Trading & Adviser with ChatGPT, Gemini, DeepSeek, Claude
9.8%
ROI
1
Faktor laba

Harga

Sejak 18/12/2024
2
Penjualan
4.26K
Instal gratis