present
سجل واحصل على خصم 50 دولارًا على مشترياتك الأولى
Trading product for E7 BBKG NumSharp Sample cBot AI, image 1
E7 BBKG NumSharp Sample
cBot
310 التنزيلات
الإصدار 1.0، Feb 2025
Windows, Mac, Mobile, Web
Trading product for E7 BBKG NumSharp Sample cBot AI, image 2
منذ 18/12/2024
2
المبيعات
4.67K
التثبيتات المجانية

الوصف

كما طلب الكثير منكم، نحن الآن نعمل جاهدين لتوفير أمثلة لبعض أكواد التعلم الآلي والحزم الخاصة بنا.

TensorFlow، PyTorch، Keras، Numpy، Pandas والعديد من حزم .NET الأخرى للبدء داخل cTrader.

مهمتنا هي جعل التعلم الآلي داخل cTrader أسهل للجميع.

صيد موفق!

*** هذا الكود لا يقوم بأي تداول (فقط يطبع البيانات وما إلى ذلك). إنه مجرد كود نموذجي لكيفية بدء إنشاء نماذج الذكاء الاصطناعي الخاصة بك باستخدام حزم التعلم الآلي الخاصة بنا.

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

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()
        {
            // تهيئة أي مؤشرات
        }

        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($"خطأ: {ex.Message}");
                if (ex.InnerException != null)
                {
                    Print($"الاستثناء الداخلي: {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
        public void DataSplitPrints()
        {
            // إعادة تشكيل بيانات الإدخال لتتناسب مع شكل الإدخال المتوقع للنموذج
            //var inputShape = new Shape(-1, BarsRequired, 5);
            NDArray inputData = np.array<float>(GetDataSet());
            Print("مدخلات NDarray: " + string.Join(", ", inputData));
            
            // إعادة تشكيل بيانات الهدف لتتناسب مع الشكل المتوقع للهدف من قبل النموذج
            //var targetShape = new Shape(-1, 5);
            NDArray targetData = np.array<float>(GetTargetDataSet());
            Print("هدف NDarray: " + string.Join(", ", targetData));
            
            // تقسيم البيانات إلى مجموعات تدريب واختبار
            int testSize = (int)(0.2 * inputData.shape[0]); // 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: " + string.Join(", ", x_train));
            Print("بيانات X_test: " + string.Join(", ", x_test));
            Print("بيانات Y_train: " + string.Join(", ", y_train));
            Print("بيانات Y_test: " + string.Join(", ", y_test));
        }
        
        /// طباعة PandasNet
        public void PandasPrints()
        {
            // تحويل float[,] إلى 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()));
            }
            // إنشاء DataFrames
            DataFrame inputDataFrame = new DataFrame(inputSeriesList);
            DataFrame targetDataFrame = new DataFrame(targetSeriesList);
            
            Print("إطار بيانات الإدخال: " + inputDataFrame);
            Print("إطار بيانات الهدف: " + targetDataFrame);
            
            //Print("Input DataFrame: " + string.Join(", ", inputDataFrame));
            //Print("Target DataFrame: " + string.Join(", ", targetDataFrame));
        }
        
        /// طباعة بسيطة لمصفوفات NumSharp NDArray
        public void NDArrayPrints()
        {
            if (Bars.ClosePrices.Count < BarsRequired)
                return;

            try
            {
                // استدعاء بيانات الإدخال float[,]
                float[,] inputData = GetDataSet();

                // التحويل إلى NDArray وإعادة تشكيله إلى (BarsRequired, 5)
                NDArray inputNDArray = np.array(inputData);   // NumSharp
                Print("بيانات NumSharp NDarray للإدخال : " + string.Join(", ", inputNDArray));
                Print("شكل NumSharp NDarray للإدخال: " + string.Join(", ", inputNDArray.shape));
                
                int expectedLength = BarsRequired * 5;
                Print($"الطول المتوقع لمصفوفة NumSharp NDarray: {expectedLength}");
                Print($"حجم NumSharp NDarray للإدخال: {inputNDArray.size}");

                if (inputNDArray.size != expectedLength)
                {
                    Print($"عدم تطابق الطول: الطول المتوقع {expectedLength}، لكن الحجم الفعلي {inputNDArray.size}");
                    return;
                }
            }
            catch (Exception ex)
            {
                Print("استثناء: " + ex.Message);
                Print("تتبع المكدس: " + ex.StackTrace);

                Exception innerException = ex.InnerException;
                while (innerException != null)
                {
                    Print("الاستثناء الداخلي: " + innerException.Message);
                    Print("تتبع المكدس للاستثناء الداخلي: " + innerException.StackTrace);
                    innerException = innerException.InnerException;
                }
            }
        }
    }
}

الملخص

AI summary
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.
ملف تعريف التداول

تقييمات العملاء

0.0
التقييمات: 0
تقييمات العملاء
لا توجد تقييمات لهذا المنتج حتى الآن. هل جرَّبته بالفعل؟ كن أول من يخبر الآخرين!

مناقشة

الأسئلة الشائعة

AI
يتم توفير المنتجات المتاحة من خلال cTrader Store، بما في ذلك روبوتات التداول والمؤشرات والإضافات، من قبل مطوري الطرف الثالث وإتاحتها لأغراض الوصول المعلوماتي والفني فقط. cTrader Store ليس وسيطًا ولا يقدم نصائح استثمارية أو توصيات شخصية أو أي ضمان للأداء المستقبلي.

المزيد من هذا المؤلف

مؤشر
E7 Volume Profile, more modern look and feel.
شعار "E7 BBKG Indicator"
الأعلى تقييمًا
4.5
(4)
$25
/
$50
مؤشر
Prop
E7 BBKG indicator with 80% plus accuracy used to show both, possible reversal and trend.
شعار "E7 Polynomial Regression Channel"
الأعلى تقييمًا
4.8
(5)
مجاني
مؤشر
Polynomial Regression Channel which also reflects the volatility of the underlying asset.
مؤشر
E7 Harmonic Structures Basic.
مؤشر
E7 Correlation Dashboard.
مؤشر
Bollinger
Bollinger Band Cloud, Heiken Ashi, Trend Follower and Parabolic SAR.
مؤشر
Indices
Option pricing using the BlackScholes model and the Math.Numerics packages
مؤشر
Bollinger
ADXR, KDJ, SineWave, Bollinger Band Volatility and AEOscillator.

قد يعجبك أيضًا

cBot
AI
Forex
+3
Pulsix Pro - Professional Automated Trading Robot
cBot
Versatile Adaptive System, for Scalper, Long trader, HFT
cBot
RSI
This is an advanced tool designed to protect your trading account by managing drawdown and run-up levels.
cBot
Fixed Lot
Equity Stop
+5
Copy trades between cTrader accounts on one PC or VPS. Symbol names mapped across brokers for you. Three-step setup.
شعار "Neuralis"
مشهور
4.0
(1)
$50
cBot
AI
Grid
+3
AI-Powered Trading Algorithm. Precision Engineered for Disciplined Traders
1.28
عامل الربح
cBot
VWAP
Fibonacci
+5
Autonomous Nasdaq execution engine featuring VWAP confluence, macro sweeps, and strict prop-firm drawdown defense.
8%
العائد على الاستثمار
11.67
عامل الربح
cBot
DreamProfitFXBot hunts pips daily with precision, filters out noise, and locks profits fast. Built for sharp day-traders
cBot
AI
RSI
+7
Prices Action Focus Bot, Please use default setting before making any changes!!! ENJOY!!!
cBot
Prop
Forex
+3
QuantumGuard - EUR/USD - More than 1000% profit per year
41.1%
العائد على الاستثمار
1.69
عامل الربح
cBot
RSI Scalping cBot—plug‑and‑play precision scalper for volatile indexes and symbols.
cBot
EMA
MACD
+5
A disciplined MACD‑EMA trading bot with smart protection, timed SL control, and reliable automated trade execution.
1
عامل الربح
cBot
// XAU/USD 1H TIMEFRAME // 5 YEARS BACKTEST, PROFIT 2100 USD, DRAWDOWN MAX 195 USD 
cBot
AI
ATR
+17
ORB fully automated trading strategies #candle confirmation
cBot
AI
ATR
+26
Review and User Guide: PROP Account Guardian Pro cBot 🛡️
cBot
EMA
Balanced
+2
Pharaoh Bot Back tested for 6 years tick data
1.64
عامل الربح
cBot
Fixed Lot
Key Levels
+5
Copy signals to cTrader with auto execution, advanced risk management, and stealth mode.
cBot
Prop Firm Fit
Trailing Stop
+4
Copy trades remotely from different computers with risk management, prop firm compliance, and dynamic lot sizing.
cBot
ATR
Grid Recovery
+2
Modern griding bot with ATR features.
136%
العائد على الاستثمار
2.36
عامل الربح

السعر

منذ 18/12/2024
2
المبيعات
4.67K
التثبيتات المجانية