"E7 BBKG NumSharp Sample" โลโก้
cBot
228 ดาวน์โหลด
เวอร์ชัน 1.0, Feb 2025
Windows, Mac, Mobile, Web
"E7 BBKG NumSharp Sample" ภาพที่อัปโหลด
ตั้งแต่ 18/12/2024
2
การขาย
4.07K
ติดตั้งฟรี

ตามคำขอของหลายๆ คน ตอนนี้เรากำลังทำงานอย่างหนักเพื่อจัดเตรียมตัวอย่างโค้ดและแพ็กเกจการเรียนรู้ของเครื่องบางส่วนของเรา

TensorFlow, PyTorch, Keras, Numpy, Pandas และแพ็กเกจ .NET อีกมากมายเพื่อเริ่มต้นใช้งานภายใน cTrader

ภารกิจของเราคือทำให้การเรียนรู้ของเครื่องภายใน cTrader ง่ายขึ้นสำหรับทุกคน

ขอให้สนุกกับการค้นหา!

*** โค้ดนี้ไม่ได้ทำการเทรดใดๆ (เพียงแค่พิมพ์ข้อมูลออกมา ฯลฯ) เป็นเพียงโค้ดตัวอย่างของวิธีที่คุณสามารถเริ่มสร้างโมเดล AI ของคุณเองโดยใช้แพ็กเกจการเรียนรู้ของเครื่องของเรา

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

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 Data Split Prints
        public void DataSplitPrints()
        {
            // ปรับรูปแบบข้อมูลนำเข้าให้ตรงกับรูปแบบที่โมเดลคาดหวัง
            //var inputShape = new Shape(-1, BarsRequired, 5);
            NDArray inputData = np.array<float>(GetDataSet());
            Print("Input NDarray: " + string.Join(", ", inputData));
            
            // ปรับรูปแบบข้อมูลเป้าหมายให้ตรงกับรูปแบบที่โมเดลคาดหวัง
            //var targetShape = new Shape(-1, 5);
            NDArray targetData = np.array<float>(GetTargetDataSet());
            Print("Target 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 Prints
        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("Input DataFrame: " + inputDataFrame);
            Print("Target DataFrame: " + targetDataFrame);
            
            //Print("Input DataFrame: " + string.Join(", ", inputDataFrame));
            //Print("Target DataFrame: " + string.Join(", ", targetDataFrame));
        }
        
        /// Simple NumSharp NDArrays Prints
        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.
อินดิเคเตอร์
cTrader ID

นอกจากนี้คุณยังอาจชอบ

cBot
EMA
SL Manager
+5
Fully automated dual-symbol hedging cBot for cTrader.
20.6%
ROI
8.66
อัตราส่วน กำไรต่อขาดทุน
20%
Drawdown สูงสุด
cBot
AI
Grid
+4
Where Algorithmic Precision Meets Gold’s Volatility. AI-Powered Gold Trading Algorithm for cTrader.
cBot
RSI
Forex
+2
N.B.: Results with an initial invested capital of 100 euros.
cBot
Pulse Tick Reactor: AI-powered trading bot delivering precision entries, adaptive risk control, and consistent profits.
cBot
RSI
Aggressive
automates entries based on the RSX indicator — a smoothed, low-lag variant of the classic RSI.
1.67
อัตราส่วน กำไรต่อขาดทุน
10.25%
Drawdown สูงสุด
cBot
RSI
This is an advanced tool designed to protect your trading account by managing drawdown and run-up levels.
1
อัตราส่วน กำไรต่อขาดทุน
0%
Drawdown สูงสุด
"Risk Manager v2_2" โลโก้
ยอดนิยม
4.5
(2)
$40
/
$60
cBot
CHOCH
SL Manager
+1
Trade with clarity. Protect your capital. Let Risk Manager enforce the rules.
0%
Drawdown สูงสุด
cBot
BTCUSD
Crypto
LimitOrderBot - Special BTC/USD-Edition
cBot
RSI
MACD
+10
RedAndBlack: buy on bullish close, sell on bearish close. Simple trend-following trading strategy.
cBot
Prop
Forex
+5
Close 50%, 80% or Custom % , Close Full position and Move Stop to Breakeven buttons plus a floating Profit/loss counter
cBot
AI
BTCUSD
+2
Crossover Bot es un sistema de trading algorítmico actualmente en operación real, currently in live operation.
cBot
ATR
RSI
+4
UltimateAI Trading Robot – Smart Trend & Momentum Trader for cTrader
cBot
Prop Firm Fit
Stop Loss (SL) Manager
+1
HTS Strategy Tester - Advanced Multi-Timeframe Trend & Pullback Trading System H1/m1 & H4/m5 WWS 33/144 Start from 100$
90.1%
ROI
2.92
อัตราส่วน กำไรต่อขาดทุน
37%
Drawdown สูงสุด
cBot
RSI
MACD
+9
EURGBP MARKET ORDER TRADING ALGORITHM
2.41
อัตราส่วน กำไรต่อขาดทุน
13.69%
Drawdown สูงสุด
cBot
XAUUSD
Bollinger
+1
Sfrutta il breakout delle bande di bollinger.
"Breakout Premium Pro v2.0" โลโก้
ยอดนิยม
4.3
(3)
$49
/
$97
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
Volume
Key Levels
Export OHLC data from any backtest to CSV. Works on Candles, Renko, Tick, Range. Perfect for external analysis.
cBot
Grid
Forex
+9
This tool will help you spread your trades very quickly with a few clicks
ตั้งแต่ 18/12/2024
2
การขาย
4.07K
ติดตั้งฟรี