present
Daftar dan dapatkan potongan bernilai $50 untuk pembelian pertama anda
Trading product for E7 BBKG NumSharp Sample cBot AI, image 1
E7 BBKG NumSharp Sample
cBot
292 muat turun
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
Jualan
4.55K
Pemasangan percuma

Penerangan

Seperti yang diminta oleh ramai daripada anda, kami kini sedang bekerja keras untuk menyediakan contoh beberapa kod dan pakej pembelajaran mesin kami.

TensorFlow, PyTorch, Keras, Numpy, Pandas dan banyak lagi pakej .NET untuk memulakan di dalam cTrader.

Misi kami adalah untuk memudahkan Pembelajaran Mesin di dalam cTrader untuk semua orang.

Selamat memburu!

*** Kod ini tidak melakukan sebarang dagangan (ia hanya mencetak data dan sebagainya). Ia hanyalah kod contoh bagaimana anda boleh mula mencipta model AI anda sendiri menggunakan pakej 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("Bar Diperlukan", DefaultValue = 50, MinValue = 1, MaxValue = 10000, Step = 1)]
        public int BarsRequired { get; set; }

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

        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($"Ralat: {ex.Message}");
                if (ex.InnerException != null)
                {
                    Print($"Pengecualian Dalaman: {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;
        }
        
        /// Cetakan Pecahan Data NumSharp
        public void DataSplitPrints()
        {
            // Bentuk semula data input untuk memadankan bentuk input yang dijangka oleh model
            //var inputShape = new Shape(-1, BarsRequired, 5);
            NDArray inputData = np.array<float>(GetDataSet());
            Print("Input NDarray: " + string.Join(", ", inputData));
            
            // Bentuk semula data sasaran untuk memadankan bentuk sasaran yang dijangka oleh model
            //var targetShape = new Shape(-1, 5);
            NDArray targetData = np.array<float>(GetTargetDataSet());
            Print("Target NDarray: " + string.Join(", ", targetData));
            
            // Bahagikan data kepada set latihan dan ujian
            int testSize = (int)(0.2 * inputData.shape[0]); // 20% untuk ujian
            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()
        {
            // Tukar float[,] kepada Senarai<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()));
            }
            
            // Cipta DataFrame
            DataFrame inputDataFrame = new DataFrame(inputSeriesList);
            DataFrame targetDataFrame = new DataFrame(targetSeriesList);
            
            Print("Input DataFrame: " + inputDataFrame);
            Print("Target DataFrame: " + targetDataFrame);
            
            //Print("Input DataFrame: " + string.Join(", ", inputDataFrame));
            //Print("Target DataFrame: " + string.Join(", ", targetDataFrame));
        }
        
        /// Cetakan NumSharp NDArrays Mudah
        public void NDArrayPrints()
        {
            if (Bars.ClosePrices.Count < BarsRequired)
                return;

            try
            {
                // Memanggil Data Input float[,] anda
                float[,] inputData = GetDataSet();

                // Tukar kepada NDArray dan bentuk semula kepada (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 Dijangka: {expectedLength}");
                Print($"Saiz NumSharp NDarray Input: {inputNDArray.size}");

                if (inputNDArray.size != expectedLength)
                {
                    Print($"Panjang Tidak Padan: Panjang Dijangka {expectedLength}, tetapi mendapat Saiz {inputNDArray.size}");
                    return;
                }
            }
            catch (Exception ex)
            {
                Print("Pengecualian: " + ex.Message);
                Print("Jejak Tumpukan: " + ex.StackTrace);

                Exception innerException = ex.InnerException;
                while (innerException != null)
                {
                    Print("Pengecualian Dalaman: " + innerException.Message);
                    Print("Jejak Tumpukan Pengecualian Dalaman: " + 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 dagangan

Ulasan pelanggan

0.0
Ulasan: 0
Ulasan pelanggan
Belum ada ulasan untuk produk ini. Anda sudah mencuba produk tersebut? Jadilah yang pertama untuk berkongsi pendapat anda!

Perbincangan

Soalan Lazim

AI
Produk yang tersedia melalui cTrader Store, termasuk bot dagangan, indikator dan plugin, disediakan oleh pembangun pihak ketiga dan diberikan akses untuk tujuan maklumat dan teknikal sahaja. cTrader Store bukan broker dan tidak memberikan nasihat pelaburan, syor peribadi atau sebarang jaminan prestasi masa hadapan.

Lebih banyak produk daripada penulis ini

Indikator
E7 Volume Profile, more modern look and feel.
Logo "E7 BBKG Indicator"
Dinilai teratas
4.5
(4)
$25
/
$50
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 juga mungkin suka

cBot
SL Manager
TP Manager
+2
cBot de Risk Control para cTrader que calcula el lotaje según el riesgo y coloca automáticamente Stop Loss y Take Profit
cBot
Forex
BTCUSD
+3
OneClick SL/TP Setter — Smart Trade Management Made Simple
cBot
Equity Stop
ECN-friendly
+5
A precision grid-scalper for Gold (XAUUSD). Designed for stable markets with built-in profit locking and strict risk con
36.79
Faktor keuntungan
cBot
Forex
NAS100
+5
Session-based trading bot with intelligent trailing stops. Captures Asia range, trades London/NY breakouts
8.86
Faktor keuntungan
cBot
AI
ATR
+27
A smart trailing-stop tool that protects profits and tightens risk automatically for all your manual trades.
cBot
Automatiza tus operaciones con esta estrategia de cruce de medias móviles exponenciales (EMAs). EMA Crossover Pro.
cBot
ATR
Forex
EMA-Crossover-Bot mit ADX-Filter:Trend-Trading mit ATR-basiertem Risikomanagement und Trailing Stop.
cBot
ATR
Forex
+5
Profitable low-risk robot, ROI 32%
43.9%
ROI
7.51
Faktor keuntungan
cBot
Volume
Risk/Reward
+4
Pre-trade risk assistant that checks risk, R:R and daily limits before you enter a manual trade.
Logo "AURIX"
Popular
5.0
(2)
$39
/
$78
cBot
AI
Grid
+4
Where Algorithmic Precision Meets Gold’s Volatility. AI-Powered Gold Trading Algorithm for cTrader.
cBot
Pulse Tick Reactor: AI-powered trading bot delivering precision entries, adaptive risk control, and consistent profits.
cBot
ATR
RSI
+23
🚀 N.B.: Results with an initial invested capital of 100 euros.🚀 📌 Tested on US2000 with Accurate Prices
cBot
SMC
Forex
+11
💎 ICT Silver Bullet Strategy cBot — liquidity sweep & breakout algorithm with risk control.
cBot
RSI
Grid
+3
Demo version of https://ctrader.com/products/298
cBot
Fixed Lot
TP Manager
+5
Automatically copies trading signals from your channels or groups straight to your cTrader account.
cBot
AI
ATR
+27
Depth of Market + VIX Bot - Complete Analysis
cBot
SL Manager
TP Manager
+2
Risk Control App that calculates the lot size according to the risk and automatically places Stop Loss and Take Profit

Harga

Sejak 18/12/2024
2
Jualan
4.55K
Pemasangan percuma