present
Daftar dan dapatkan diskon $50 untuk pembelian pertama Anda
Trading product for E7 BBKG NumSharp Sample cBot AI, image 1
E7 BBKG NumSharp Sample
cBot
292 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.57K
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.
Logo "E7 BBKG Indicator"
Peringkat 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 mungkin juga suka

cBot
EMA
TP Manager
+5
Multi-asset trend-following cBot for Forex, crypto, gold, indices, and more, with configurable risk management.
1.36
Faktor laba
cBot
Forex
EURUSD
+5
EMBER is a breakout robot designed around one of the most respected price action patterns in trading.
cBot
Break Even
Risk/Reward
+3
Plan gold trades with basket risk sizing, up to three targets, breakeven and trailing protection.
cBot
XAUUSD
Bollinger
+1
Sfrutta il breakout delle bande di bollinger.
cBot
Key Levels
One-click Trading
FREE XAUUSD Level-Based Trading cBot
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
cBot
Key Levels
Spread Filter
+3
MATRIX INFINITY, See Beyond the Market.
22.3%
ROI
31
Faktor laba
cBot
Der MultiStrategyScalpingBot ist ein automatisierter Handelsroboter für die cAlgo-Plattform.
cBot
Forex
BTCUSD
+11
BoletaProfit - Advanced Order Ticket full version for cTrader
cBot
RSI
Forex
+5
Low drawdown RSI Forex Bot for EURUSD & GBPJPY. Starts from $20 with projected 50%+
40.7%
ROI
50
Faktor laba
cBot
SL Manager
Trailing Stop
+2
Smart trade management, automatically protects positions, progressively locks in profits as trades move in your favor.
cBot
Key Levels
This indicator sets all major timeframe lines and sets reversal points that have a high point of reversal
cBot
Scalping
ICT Framework cBot – Advanced Trading Automation for Any Pair & Timeframe
cBot
ATR
RSI
+4
UltimateAI Trading Robot – Smart Trend & Momentum Trader for cTrader
60.1%
ROI
1.37
Faktor laba
cBot
AI
SMC
+18
Quick Trading Panel Cbot allows you to trade faster using a panel in a chart. This includes Trailing Trigger and Locked.
3
Faktor laba
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
Trend strategy Algorithm 20 DAYS DEMO .,risk/reward ratio (R/R) of 1:2 ,efficient risk management.

Harga

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