Trading product for E7 BBKG NumSharp Sample cBot AI, image 1
cBot
243 التنزيلات
الإصدار 1.0، Feb 2025
Windows, Mac, Mobile, Web
Trading product for E7 BBKG NumSharp Sample cBot AI, image 2
منذ 18/12/2024
2
المبيعات
4.17K
التثبيتات المجانية

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

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;
                }
            }
        }
    }
}

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

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

مؤشر
E7 Volume Profile, more modern look and feel.
مؤشر
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
Indices
🚀N.B.: Results with an initial invested capital of 100 euros.
cBot
ADX
EMA
+5
Apex CFX - NAS100 Control is a structured automated trading cBot designed for NAS100 / Nasdaq 100, using EMA alignment,
15%
العائد على الاستثمار
5.1
عامل الربح
cBot
Partial Close
Prop Firm Fit
+5
Trade Management with pre program desire scaling, lot increase, TP placement, Trilling and $ value stop for loss/gain
cBot
RSI
Signal
+3
## **Matrix Gold Resurrection - Professional XAUUSD Trading Algorithm** **🏆 Advanced Gold Trading Bot
cBot
ATR
Signal
+1
✨ N.B.: Results with an initial invested capital of 100 euros.📈
cBot
// XAU/USD 1H TIMEFRAME // 5 YEARS BACKTEST, PROFIT 2100 USD, DRAWDOWN MAX 195 USD 
cBot
AI
Grid
+7
AI Trading & Adviser with ChatGPT, Gemini, DeepSeek, Claude
cBot
Perfectly optimized to trade AUDUSD. Over 85% win rate
cBot
AI
Grid
+4
Institutional-Grade AI for Retail Traders,Trade Like a Central Bank.
cBot
Forex
BTCUSD
+13
SUPPORT AND RESISTANCE STRATEGY. Master the Market’s Turning Points with Surgical Accuracy. SEE THE FULL BACKTEST. 📈
cBot
RSI
Forex
+2
N.B.: Results with an initial invested capital of 100 euros.
cBot
Trading_stop Plus 🧾 General Description Trading_stop Plus is the complete, enhanced version of the original Trading_sto
cBot
Prop
Forex
+11
Manage trades visually! Secure profits with Auto Partials & Trailing Shield. Works on all cTrader markets.
35.2%
العائد على الاستثمار
4
عامل الربح
cBot
AI
Forex
+3
Pulsix Pro - Professional Automated Trading Robot
cBot
ATR
Aggressive
+5
FREE backtest-only. Reproduce Pegasus Nasdaq's +215.92% in your own cTrader - no grid, no martingale. REAL EDGE
1.69
عامل الربح
cBot
ATR
No Overtrading
+3
Intelligent negotiations and analysis Voice-based price action !Limited time offer!
21.2%
العائد على الاستثمار
3
عامل الربح
cBot
ATR
SL Manager
+3
Este cBot está diseñado para operar rupturas de rango en BTCUSD con una logica simple
49.6%
العائد على الاستثمار
1.44
عامل الربح
cBot
Forex
BTCUSD
+5
DRAGON FIRE Trial Day 15
منذ 18/12/2024
2
المبيعات
4.17K
التثبيتات المجانية