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

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

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
AI
ATR
+27
TrustGuard - Simple, Smart Account Protection for cTrader
cBot
ADX
EMA
+5
Apex CFX - NAS100 Control is a structured automated trading cBot designed for NAS100 / Nasdaq 100, using EMA alignment,
15%
ROI
5.1
อัตราส่วน กำไรต่อขาดทุน
12%
Drawdown สูงสุด
cBot
ATR
RSI
+17
The Swiss Army Knife cBot is a multi-tool trading robot that combines 10 of the most popular technical indicators
cBot
Prop
Forex
+2
Aggressive Gold Bot: BB+MACD strategy. Smart ATR-based risk management. Professional on-chart trading dashboard
1.32
อัตราส่วน กำไรต่อขาดทุน
12.98%
Drawdown สูงสุด
cBot
Trading_stop Plus 🧾 General Description Trading_stop Plus is the complete, enhanced version of the original Trading_sto
cBot
Fixed Lot
VPS Recommended
+3
A high-performance cTrader local trade copier . Copy positions and pending orders between multiple terminals instantly.
"Gold Pulse Pro" โลโก้
ยอดนิยม
4.3
(3)
$39
/
$40
cBot
AI
XAUUSD
+4
Gold Pulse Pro – An automated trading system for gold (XAUUSD) precisely engineered and powered by advanced algorithms
cBot
EMA
SL Manager
+5
Fully automated dual-symbol hedging cBot for cTrader.
20.6%
ROI
8.66
อัตราส่วน กำไรต่อขาดทุน
20%
Drawdown สูงสุด
cBot
Volume
Key Levels
Export OHLC data from any backtest to CSV. Works on Candles, Renko, Tick, Range. Perfect for external analysis.
cBot
Channel
SL Manager
+4
cTrader to Telegram trade notifier with custom message formats, risk alerts, and an on-chart dashboard.
cBot
RSI
Signal
The strategy detects "Hammer" and "Shooting Star" patterns with RSI confirmation, using fixed Take Profit and Stop Loss.
cBot
GBPUSD
Indices
last test
cBot
AI
ATR
+27
Overnight trades? Pc needs shut down? Sleep disruption from alerts? Could have avoided Loss with BE Partial Monitored ?
cBot
AI
SMC
+9
AutoBreakeven Pro – Smart automatic breakeven tool by Stop Loss Ratio
0.01
อัตราส่วน กำไรต่อขาดทุน
0.01%
Drawdown สูงสุด
"Algo Forex (Trial)" โลโก้
เรตติ้งสูง
4.8
(7)
ฟรี
cBot
AI
Grid
+7
Algo Forex Strategy ( Trial )
cBot
Grid
XAUUSD
+2
🔥 Grid Classic – A Simple Yet Powerful Grid System
"Scalper Pro PROP" โลโก้
ยอดนิยม
4.3
(3)
$49
/
$89
cBot
AI
ATR
+8
Breakout scalping with prop-firm grade equity control.
cBot
Forex
Crypto
+2
The cTrader Risk & Reward management tool can easily help you to set the risk vs reward values
ตั้งแต่ 18/12/2024
2
การขาย
4.1K
ติดตั้งฟรี