E7 BBKG NumSharp Sample
cBot
259 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.25K
Ü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
Forex
+2
✨ Lisa EURUSD Breakout - Session Box Precision for EURUSD. Up to +176% in 30 Days✨
855%
ROI
4
Kâr faktörü
cBot
RSI‑driven scalper for the most volatile asset classes.
cBot
AI
NAS100
+3
DeMark Volume Pro Multi-Style Suite
19.24
Kâr faktörü
cBot
Grid
XAUUSD
+2
🔥 Grid Classic – A Simple Yet Powerful Grid System
cBot
SMC
Prop
+12
Risk On Trade | Auto Position Size Calculator | Risk & Reward Tool | Auto Lot Size Calculator
cBot
AI
ATR
+8
Supertrend RSI ADX is a trading system built for traders who demand precision, control, and steady performance.
cBot
Prop
Forex
+2
Lock your risk before you click Buy or Sell. Entering a trade without clearly defined risk!
cBot
Prop
Forex
+2
Ultimate Trade Panel - a powerful, on-chart trading tool designed for precision and efficiency.
0.01
Kâr faktörü
cBot
ATR
RSI
+11
proactive swing detection and entry with multiple trade filters..high stable returns,minimal drawdowns
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
ATR
AI Trading
+3
This strategy is based on gold short term intense momentum. scalps based on time and price theory
25.4%
ROI
1.45
Kâr faktörü
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
Scalping
Special H1-Version of UltimateScalper for EUR/GBP ... win rate 100% ... ROI 830%
cBot
Trading_stop Plus 🧾 General Description Trading_stop Plus is the complete, enhanced version of the original Trading_sto
cBot
Forex
EURUSD
Easy Trade, Just Plug and Play!
cBot
ATR
EMA
+5
Momentum driven, Compounding. Volatility adaptive EMA BOLLINGER ATR base Strategy
93.4%
ROI
1.31
Kâr faktörü
cBot
ADX
ATR
+5
Ai_GoldScalperPro XAU M15 – Premium Scalping Robot for cTrader
7.9%
ROI
1.92
Kâr faktörü
cBot
Forex
BTCUSD
+7
Fully functional demo runs until January 31, 2026 with over 100% ROI within 14 days

Fiyat

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