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

الوصف

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

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
ATR
EMA
+5
Incorporate EMA, RSI, and ATR to detect strong trends and execute precise entries
cBot
EMA
SL Manager
+5
Fully automated dual-symbol hedging cBot for cTrader.
20.6%
العائد على الاستثمار
8.66
عامل الربح
cBot
Forex
EURUSD
+2
Crude Oil TRIAL DAY 15
cBot
ATR
Aggressive
+1
Agressive griding bot
136%
العائد على الاستثمار
1.38
عامل الربح
cBot
This cBot "GBPJPYM5ScalperX" implements a scalping strategy on the GBP/JPY 5-minute chart.
cBot
AI
RSI
+8
Spectral Frequency Engine — AI-Driven FFT cbot for EUR/USD (M5)
cBot
Break Even
Equity Stop
+5
Enforces your loss limits 24/7, also on a VPS, and runs the break-even and partials set in the Risk Manager.
cBot
EMA
TP Manager
+5
Multi-asset trend-following cBot for Forex, crypto, gold, indices, and more, with configurable risk management.
1.36
عامل الربح
cBot
Grid
Forex
+9
This tool will help you spread your trades very quickly with a few clicks
cBot
AI
Forex
+4
Trend Following Strategy with adjustment Risk Management PLEASE ENJOY!!
10.9%
العائد على الاستثمار
3.2
عامل الربح
cBot
Prop
Forex
+11
A Fintech-Engineered Investment Opportunity in Algorithmic Gold Trading
cBot
Forex
Scalping
Special H1-Version of UltimateScalper for EUR/GBP ... win rate 100% ... ROI 830%
cBot
AI Trading
Risk/Reward
+1
UFO Risk Manager is an advanced cTrader cBot designed for precise trade management, instant break-even, smart recovery..
8.2%
العائد على الاستثمار
1
عامل الربح
cBot
// XAU/USD 1H TIMEFRAME // 5 YEARS BACKTEST, PROFIT 2100 USD, DRAWDOWN MAX 195 USD 
شعار "1% Strategy"
مشهور
4.0
(2)
$39
/
$59
cBot
AI
Scalp you rich!
cBot
ATR
RSI
Hedging AI
cBot
AI
ATR
+8
A sophisticated cBot that implements a Fair Value Gap (FVG) trading strategy with comprehensive risk management
cBot
AI
ATR
+27
Review and User Guide: PROP Account Guardian Pro cBot 🛡️

السعر

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