present
Zarejestruj się i otrzymaj 50 $ zniżki na pierwszy zakup
Trading product for E7 BBKG NumSharp Sample cBot AI, image 1
E7 BBKG NumSharp Sample
cBot
281 pobrania
Wersja 1.0, Feb 2025
Windows, Mac, Mobile, Web
Trading product for E7 BBKG NumSharp Sample cBot AI, image 2
Od 18/12/2024
2
Sprzedaż
4.43K
Bezpłatne instalacje

Opis

Na prośbę wielu z Was, obecnie intensywnie pracujemy nad dostarczeniem przykładów niektórych naszych kodów i pakietów do uczenia maszynowego.

TensorFlow, PyTorch, Keras, Numpy, Pandas i wiele innych pakietów .NET, aby zacząć pracę w środowisku cTrader.

Naszą misją jest ułatwienie korzystania z uczenia maszynowego w cTrader dla każdego.

Powodzenia!

*** Ten kod nie dokonuje żadnych transakcji (tylko wypisuje dane itp.). To po prostu przykładowy kod pokazujący, jak można zacząć tworzyć własne modele AI korzystając z naszych pakietów do uczenia maszynowego.

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

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()
        {
            // Inicjalizacja wskaźników
        }

        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($"Błąd: {ex.Message}");
                if (ex.InnerException != null)
                {
                    Print($"Wewnętrzny wyjątek: {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 Data Split Prints
        public void DataSplitPrints()
        {
            // Przekształć dane wejściowe, aby dopasować kształt oczekiwany przez model
            //var inputShape = new Shape(-1, BarsRequired, 5);
            NDArray inputData = np.array<float>(GetDataSet());
            Print("Input NDarray: " + string.Join(", ", inputData));
            
            // Przekształć dane docelowe, aby dopasować kształt oczekiwany przez model
            //var targetShape = new Shape(-1, 5);
            NDArray targetData = np.array<float>(GetTargetDataSet());
            Print("Target NDarray: " + string.Join(", ", targetData));
            
            // Podziel dane na zestawy treningowe i testowe
            int testSize = (int)(0.2 * inputData.shape[0]); // 20% na testy
            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("Dane X_train: " + string.Join(", ", x_train));
            Print("Dane X_test: " + string.Join(", ", x_test));
            Print("Dane Y_train: " + string.Join(", ", y_train));
            Print("Dane Y_test: " + string.Join(", ", y_test));
        }
        
        /// Wydruki PandasNet
        public void PandasPrints()
        {
            // Konwersja float[,] na 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()));
            }
            // Utwórz DataFrame'y
            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));
        }
        
        /// Proste wydruki NumSharp NDArrays
        public void NDArrayPrints()
        {
            if (Bars.ClosePrices.Count < BarsRequired)
                return;

            try
            {
                // Wywołanie Twoich danych wejściowych float[,]
                float[,] inputData = GetDataSet();

                // Konwersja do NDArray i przekształcenie do (BarsRequired, 5)
                NDArray inputNDArray = np.array(inputData);   // NumSharp
                Print("Dane wejściowe NumSharp NDarray: " + string.Join(", ", inputNDArray));
                Print("Kształt NumSharp NDarray danych wejściowych: " + string.Join(", ", inputNDArray.shape));
                
                int expectedLength = BarsRequired * 5;
                Print($"Oczekiwana długość NumSharp NDarray: {expectedLength}");
                Print($"Rozmiar NumSharp NDarray danych wejściowych: {inputNDArray.size}");

                if (inputNDArray.size != expectedLength)
                {
                    Print($"Niezgodność długości: oczekiwana długość {expectedLength}, ale otrzymano rozmiar {inputNDArray.size}");
                    return;
                }
            }
            catch (Exception ex)
            {
                Print("Wyjątek: " + ex.Message);
                Print("Ślad stosu: " + ex.StackTrace);

                Exception innerException = ex.InnerException;
                while (innerException != null)
                {
                    Print("Wewnętrzny wyjątek: " + innerException.Message);
                    Print("Ślad stosu wewnętrznego wyjątku: " + innerException.StackTrace);
                    innerException = innerException.InnerException;
                }
            }
        }
    }
}

Podsumowanie

Podsumowanie 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 handlowy

Opinie klientów

0.0
Opinie: 0
Opinie klientów
Ten produkt nie ma jeszcze opinii. Wypróbowałeś(-aś) go już? Bądź pierwszy(-a) i powiedz o tym innym!

Dyskusja

Częste pytania

AI
Produkty dostępne za pośrednictwem cTrader Store, w tym boty handlowe, wskaźniki i wtyczki, dostarczane są przez deweloperów zewnętrznych i udostępniane wyłącznie w celach informacyjnych oraz w celu zapewnienia dostępu technicznego. cTrader Store nie jest brokerem i nie zapewnia doradztwa inwestycyjnego, nie udziela spersonalizowanych rekomendacji ani nie gwarantuje przyszłych wyników.

Więcej od tego autora

Wskaźnik
E7 Volume Profile, more modern look and feel.
Logo „E7 BBKG Indicator”
Najwyżej oceniane
4.5
(4)
$25
/
$50
Wskaźnik
Prop
E7 BBKG indicator with 80% plus accuracy used to show both, possible reversal and trend.
Wskaźnik
Polynomial Regression Channel which also reflects the volatility of the underlying asset.
Wskaźnik
E7 Harmonic Structures Basic.
Wskaźnik
E7 Correlation Dashboard.
Wskaźnik
Bollinger
Bollinger Band Cloud, Heiken Ashi, Trend Follower and Parabolic SAR.
Wskaźnik
Indices
Option pricing using the BlackScholes model and the Math.Numerics packages
Wskaźnik
Bollinger
ADXR, KDJ, SineWave, Bollinger Band Volatility and AEOscillator.

Możesz także polubić

cBot
AI
ATR
+27
Overnight trades? Pc needs shut down? Sleep disruption from alerts? Could have avoided Loss with BE Partial Monitored ?
cBot
Place market or pending trades fast with draggable SL, risk-based sizing & clean, efficient execution tools.
cBot
Advanced forex trade panel for risk, margin, swaps, and trade control with precision tools.
cBot
Forex
NAS100
+5
Session-based trading bot with intelligent trailing stops. Captures Asia range, trades London/NY breakouts
8.86
Współczynnik zysku
cBot
ATR
No Overtrading
+3
Intelligent negotiations and analysis Voice-based price action !
21.2%
ROI
3
Współczynnik zysku
cBot
Volume
Break Even
+5
🔥 "Ride the Big Moves. Recover the Bad Ones. Repeat." Turn Trends into Profit & Losses into Comebacks — Automatically!
13.5%
ROI
30
Współczynnik zysku
cBot
Forex
Scalping
Special H1-Version of UltimateScalper for EUR/GBP ... win rate 100% ... ROI 830%
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
Forex
Crypto
+6
Allows you to speed up chart annotation by letting you create drawing tools via Hot Keys.
cBot
Volume
Key Levels
+4
Automate open orders with smart grid lines, DCA scaling, Martingale multipliers, and safe zone recovery.
cBot
AI
ATR
+5
No guessing — just confirmed breakouts, smart risk management, and disciplined execution. Less noise. More direction.
28.5%
ROI
4.44
Współczynnik zysku
cBot
Supertrend
Super tendance
cBot
Volume
Fibonacci
+5
Professional scanning and analysis with automatic target and stop.
5
Współczynnik zysku
cBot
Prop
Forex
+5
PivotPointsBot, leveraging the time-tested pivot point strategy!
cBot
Forex
EURUSD
+5
EasyPass ProFirm Wizard
cBot
Forex
GBPUSD
+1
Trades daily breakouts using EMA trend confirmation. Buy signals trigger when price is above EMA.

Cena

Od 18/12/2024
2
Sprzedaż
4.43K
Bezpłatne instalacje