"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
Channel
SL Manager
+4
cTrader to Telegram trade notifier with custom message formats, risk alerts, and an on-chart dashboard.
cBot
Versatile Adaptive System, for Scalper, Long trader, HFT
cBot
AI
ATR
+8
AI Trading that you can adjust to your own strategy, this AI will do a work for you, Adjust to suit your own strategy
cBot
AI
SMC
+18
Review and Parameter Guide for the "Moving Average" cBot
"SMATAN3" โลโก้
ยอดนิยม
3.6
(3)
$39
/
$42
cBot
ATR
RSI
+5
📊 EMA CROSS COMPLETE BOT - Professional Trading System
cBot
AI
AI is detecting and determine and seize the opportunities to Open a Positions and follow the current Market Trend.
cBot
Prop
Forex
+2
Ultimate Trade Panel - a powerful, on-chart trading tool designed for precision and efficiency.
0.01
อัตราส่วน กำไรต่อขาดทุน
0%
Drawdown สูงสุด
cBot
Forex
BTCUSD
+6
GOLD HUNTER TRIAL DAY15
cBot
Perfectly optimized to trade EURUSD achieving high risk reward. Win rate of over 85%
cBot
Volume
Key Levels
Export OHLC data from any backtest to CSV. Works on Candles, Renko, Tick, Range. Perfect for external analysis.
cBot
AI
NAS100
+3
DeMark Volume Pro Multi-Style Suite
19.24
อัตราส่วน กำไรต่อขาดทุน
4.55%
Drawdown สูงสุด
cBot
Prop
Forex
+11
Manage trades visually! Secure profits with Auto Partials & Trailing Shield. Works on all cTrader markets.
35.2%
ROI
4
อัตราส่วน กำไรต่อขาดทุน
0%
Drawdown สูงสุด
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
AI
ATR
+27
Depth of Market + VIX Bot - Complete Analysis
cBot
Fixed Lot
VPS Recommended
+3
A high-performance cTrader local trade copier . Copy positions and pending orders between multiple terminals instantly.
cBot
Forex
Crypto
+5
Professional execution engine for the Visual Risk Terminal. Instant batch orders, PnL syncing, and automated hedging.
1
อัตราส่วน กำไรต่อขาดทุน
0%
Drawdown สูงสุด
"Lot by Risk" โลโก้
ยอดนิยม
4.3
(3)
$40
/
$70
cBot
Prop
Forex
+4
cBot designed to assist traders in managing position risk effectively.
cBot
ATR
Indices
🚀N.B.: Results with an initial invested capital of 100 euros.
ตั้งแต่ 18/12/2024
2
การขาย
4.1K
ติดตั้งฟรี