E7 BBKG NumSharp Sample
cBot
262 i̇ndirmeler
Sürüm 1.0, Feb 2025
Windows, Mac, Mobile, Web
Trading product for E7 BBKG NumSharp Sample cBot AI, image 2
Başlangıç 18/12/2024
2
Satışlar
4.26K
Ücretsiz yüklemeler

Açıklama

Birçoğunuzun talebi üzerine, şimdi makine öğrenimi kodlarımızdan ve paketlerimizden bazı örnekler sunmak için yoğun bir şekilde çalışıyoruz.

TensorFlow, PyTorch, Keras, Numpy, Pandas ve cTrader içinde kullanmaya başlamak için daha birçok .NET paketi.

Misyonumuz, cTrader içinde Makine Öğrenimini herkes için daha kolay hale getirmektir.

İyi avlar!

*** Bu kod herhangi bir işlem yapmaz (sadece veri yazdırır vb.). Makine Öğrenimi paketlerimizi kullanarak kendi AI modellerinizi nasıl oluşturabileceğinize dair basit bir örnek koddur.

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

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()
        {
            // Herhangi bir göstergeleri başlat
        }

        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($"Hata: {ex.Message}");
                if (ex.InnerException != null)
                {
                    Print($"İç Hata: {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 Veri Bölme Yazdırmaları
        public void DataSplitPrints()
        {
            // Modelin beklediği giriş şekline uyacak şekilde giriş verisini yeniden şekillendir
            //var inputShape = new Shape(-1, BarsRequired, 5);
            NDArray inputData = np.array<float>(GetDataSet());
            Print("Giriş NDarray: " + string.Join(", ", inputData));
            
            // Modelin beklediği hedef şekline uyacak şekilde hedef verisini yeniden şekillendir
            //var targetShape = new Shape(-1, 5);
            NDArray targetData = np.array<float>(GetTargetDataSet());
            Print("Hedef NDarray: " + string.Join(", ", targetData));
            
            // Veriyi eğitim ve test setlerine ayır
            int testSize = (int)(0.2 * inputData.shape[0]); // Test için %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 verisi: " + string.Join(", ", x_train));
            Print("X_test verisi: " + string.Join(", ", x_test));
            Print("Y_train verisi: " + string.Join(", ", y_train));
            Print("Y_test verisi: " + string.Join(", ", y_test));
        }
        
        /// PandasNet Yazdırmaları
        public void PandasPrints()
        {
            // float[,] tipini List<Series> tipine dönüştür
            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'ler oluştur
            DataFrame inputDataFrame = new DataFrame(inputSeriesList);
            DataFrame targetDataFrame = new DataFrame(targetSeriesList);
            
            Print("Giriş DataFrame: " + inputDataFrame);
            Print("Hedef DataFrame: " + targetDataFrame);
            
            //Print("Giriş DataFrame: " + string.Join(", ", inputDataFrame));
            //Print("Hedef DataFrame: " + string.Join(", ", targetDataFrame));
        }
        
        /// Basit NumSharp NDArrays Yazdırmaları
        public void NDArrayPrints()
        {
            if (Bars.ClosePrices.Count < BarsRequired)
                return;

            try
            {
                // Giriş Verinizi çağırma float[,]
                float[,] inputData = GetDataSet();

                // NDArray'a dönüştür ve (BarsRequired, 5) şekline getir
                NDArray inputNDArray = np.array(inputData);   // NumSharp
                Print("Giriş NumSharp NDarray Verisi : " + string.Join(", ", inputNDArray));
                Print("Giriş NumSharp NDarray Şekli: " + string.Join(", ", inputNDArray.shape));
                
                int expectedLength = BarsRequired * 5;
                Print($"Beklenen NumSharp NDarray Uzunluğu: {expectedLength}");
                Print($"Giriş NumSharp NDarray Boyutu: {inputNDArray.size}");

                if (inputNDArray.size != expectedLength)
                {
                    Print($"Uzunluk Uyumsuzluğu: Beklenen Uzunluk {expectedLength}, ancak Boyut {inputNDArray.size} olarak alındı");
                    return;
                }
            }
            catch (Exception ex)
            {
                Print("İstisna: " + ex.Message);
                Print("Yığın İzleme: " + ex.StackTrace);

                Exception innerException = ex.InnerException;
                while (innerException != null)
                {
                    Print("İç İstisna: " + innerException.Message);
                    Print("İç İstisna Yığın İzleme: " + innerException.StackTrace);
                    innerException = innerException.InnerException;
                }
            }
        }
    }
}

Özet

YZ özeti
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.
İşlem profili

Müşteri değerlendirmeleri

0.0
Değerlendirmeler: 0
Müşteri değerlendirmeleri
Bu ürün için henüz bir değerlendirme yok. Ürünü denediniz mi? O zaman ona dair görüşlerini paylaşan ilk kişi olun!

Tartışma

SSS

AI
cTrader Store üzerinden erişilebilen işlem botları, göstergeler ve eklentiler gibi ürünler, üçüncü taraf sağlayıcılar tarafından sağlanır ve yalnızca bilgilendirme ve teknik erişim amaçlarıyla sunulur. cTrader Store bir broker değildir ve yatırım tavsiyesi, kişisel öneriler vermez veya gelecekteki performansı garanti etmez.

Bu oluşturanın diğer ürünleri

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

Şunları da beğenebilirsiniz

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
Forex
BTCUSD
+7
Fully functional demo runs until January 31, 2026 with over 100% ROI within 14 days
cBot
GBPUSD
NAS100
+1
King's War Strategy V.1 ( For Trial and Backtest )
cBot
ATR
Signal
+1
✨ N.B.: Results with an initial invested capital of 100 euros.📈
cBot
Conservative
Grid Recovery
Ziggy, an advanced algorithm designed to maximize efficiency and simplify profit control.
cBot
AI
Stocks
+1
Advanced Automated SPX Algorithmic Trading System
4
Kâr faktörü
cBot
Advanced forex trade panel for risk, margin, swaps, and trade control with precision tools.
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
Kâr faktörü
cBot
ATR
RSI
+17
The Swiss Army Knife cBot is a multi-tool trading robot that combines 10 of the most popular technical indicators
cBot
This strategy opens trades at the previous day's high/low with dynamic stop loss and risk management based on equity.
cBot
Forex
XAUUSD
GOLDEN DAY TRIAL DAY 15
cBot
Trailing Stop
Break & Retest
+4
Smart Trade H4 Breakout Matrix (lower trader, higher accuracy)
3.73
Kâr faktörü
cBot
Fibonacci
Fixed Lot
+5
Trading dashboard for fast order execution, position management, risk controls and automatic Fibonacci levels.
1.52
Kâr faktörü
cBot
RSI
This is an advanced tool designed to protect your trading account by managing drawdown and run-up levels.
1
Kâr faktörü
cBot
Perfectly optimized to trade AUDUSD. Over 85% win rate
cBot
ATR
EMA
+5
Smart Trading Bot with Rich Management Tools for FOREX PAIRS, NASDAQ, GOLD, OIL
14.4%
ROI
1.38
Kâr faktörü
cBot
Forex
Crypto
+3
This is a cBot that will detect trendlines on the chart and open trades when the price interacts with them.
cBot
AI
ATR
+27
Overnight trades? Pc needs shut down? Sleep disruption from alerts? Could have avoided Loss with BE Partial Monitored ?

Fiyat

Başlangıç 18/12/2024
2
Satışlar
4.26K
Ücretsiz yüklemeler