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
281 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.43K
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
AI
ATR
+26
Review and User Guide: PROP Account Guardian Pro cBot 🛡️
cBot
Forex
BTCUSD
+8
RiskPilot is a clean, fast trade panel for cTrader that sizes positions by account risk % in a single click.
cBot
Forex
Crypto
+6
Allows you to speed up chart annotation by letting you create drawing tools via Hot Keys.
cBot
RSI Scalping cBot scalper for volatile indexes.
cBot
AI
ATR
+21
A price-action-first algorithm to trade Breakout, Approach, and Return around prior High/Low levels—with Prop-style risk
cBot
RSI
MACD
+7
XAU Session Trend Sniper ⚡️Gold M1 scalper with smart trend filter, ATR SL/TP & session logic – no grid, no martingale
cBot
Forex
BTCUSD
+11
CandlePatternBot — Trade classic candlestick signals with bull/bear bias and SL/TP or next-pattern exits.
cBot
AI
MACD
+5
World First AI Trading now with Fibonacci Strategy Please ENJOY!! Adjust to suit your own strategy and risk management
9%
ROI
3.9
Faktor keuntungan
cBot
ATR
EMA
+4
Three regime-specific strategies, three risk modes, one bot. Pick the combination that fits the market you're trading.
1.3
Faktor keuntungan
cBot
Grid
Forex
+11
Semi bot will manage your position by moving stoploss and cover loss with 3 martingale style
cBot
Channel
SL Manager
+4
cTrader to Telegram trade notifier with custom message formats, risk alerts, and an on-chart dashboard.
cBot
AI
Forex
+2
Sophisticated GRADIENTE algorithm , performance 11% per day drawdown 4%
cBot
Automatiza tus operaciones con esta estrategia de cruce de medias móviles exponenciales (EMAs). EMA Crossover Pro.
cBot
Grid Recovery
Position Sizer
+1
Preconfigured EURUSD recovery cBot for M1 with a fixed 0.01 starting lot and optional equity protection.
1.67
Faktor keuntungan
cBot
Supertrend
Super tendance

Harga

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