"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
Forex
BTCUSD
+13
SUPPORT AND RESISTANCE STRATEGY. Master the Market’s Turning Points with Surgical Accuracy. SEE THE FULL BACKTEST. 📈
cBot
Forex
Crypto
+5
cTrader to Telegram cBot is bot helps traders send signals instantly after open/close position on cTrader.
"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
AI
RSI
+5
H1 and L1 BOT — Pure Price Action Automation - NEW VERSION IN PROGRESS...
1.52
อัตราส่วน กำไรต่อขาดทุน
0.5%
Drawdown สูงสุด
cBot
Prop
Forex
+3
FTMO Guardian. Auto-calculates lots by Risk $. Rejects errors & trades w/o SL. Protect your Prop Account
cBot
AI
RSI
+4
Please Try and ENJOY !!! Try default setting before making any changes Please!!
cBot
Volume
Fixed Lot
+5
Institutional cBot combining pure SMC, macro confluence, and a dynamic risk engine for hands-free execution.
22015.4%
ROI
8
อัตราส่วน กำไรต่อขาดทุน
25.39%
Drawdown สูงสุด
cBot
Volume
Key Levels
Export OHLC data from any backtest to CSV. Works on Candles, Renko, Tick, Range. Perfect for external analysis.
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
ADX
ATR
+4
Trend-following bot using Ichimoku, ADX and ATR; trades strong trends with strict risk filters.
1.51
อัตราส่วน กำไรต่อขาดทุน
39.61%
Drawdown สูงสุด
cBot
Grid
Forex
Meet the SmartGridBot – a cutting-edge, trend-driven grid trading bot that maximizes profit
"PositionManager" โลโก้
ยอดนิยม
5.0
(3)
$39
/
$78
cBot
Forex
Crypto
+5
Smart position sizing, visual SL/TP lines, risk-based lot calculation, RR display, margin & lot limits, and hotkey trade
cBot
EMA
SL Manager
+5
Fully automated dual-symbol hedging cBot for cTrader.
20.6%
ROI
8.66
อัตราส่วน กำไรต่อขาดทุน
20%
Drawdown สูงสุด
cBot
Advanced forex trade panel for risk, margin, swaps, and trade control with precision tools.
cBot
AI
Grid
+7
AI Trading & Adviser with ChatGPT, Gemini, DeepSeek, Claude
cBot
AI
RSI
+4
Smart Trend Trading Bot, Best Trend Identified, Please try default setting before making any changes
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
Forex
BTCUSD
+7
Fully functional demo runs until January 31, 2026 with over 100% ROI within 14 days
ตั้งแต่ 18/12/2024
2
การขาย
4.1K
ติดตั้งฟรี