├── LICENSE ├── code_cs └── README.md /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2025 inner circle viper 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /code_cs: -------------------------------------------------------------------------------- 1 | using cAlgo.API; 2 | using cAlgo.API.Internals; 3 | using cAlgo.API.Indicators; 4 | using cAlgo.API.Requests; 5 | using System.Linq; 6 | 7 | namespace cAlgo.Robots 8 | { 9 | [Robot(TimeZone = TimeZones.UTC, AccessRights = AccessRights.None)] 10 | public class PrintAllSymbolProperties : Robot 11 | { 12 | protected override void OnStart() 13 | { 14 | // Get the properties of the current chart symbol 15 | Print("Symbol Name: {0}", Symbol.Name); 16 | Print("Bid Price: {0}", Symbol.Bid); 17 | Print("Ask Price: {0}", Symbol.Ask); 18 | Print("Spread: {0}", Symbol.Spread); 19 | Print("Pip Size: {0}", Symbol.PipSize); 20 | Print("Digits: {0}", Symbol.Digits); 21 | Print("Tick Size: {0}", Symbol.TickSize); 22 | Print("Minimum Volume in Units: {0}", Symbol.VolumeInUnitsMin); 23 | Print("Maximum Volume in Units: {0}", Symbol.VolumeInUnitsMax); 24 | Print("Volume Step in Units: {0}", Symbol.VolumeInUnitsStep); 25 | Print("Pip Value: {0}", Symbol.PipValue); 26 | Print("Tick Value: {0}", Symbol.TickValue); 27 | Print("Lot Size: {0}", Symbol.LotSize); 28 | Print("Unrealized Net Profit: {0}", Symbol.UnrealizedNetProfit); 29 | Print("Unrealized Gross Profit: {0}", Symbol.UnrealizedGrossProfit); 30 | Print("Base Asset: {0}", Symbol.BaseAsset); 31 | Print("Quote Asset: {0}", Symbol.QuoteAsset); 32 | Print("PnL Conversion Fee Rate: {0}", Symbol.PnLConversionFeeRate); 33 | Print("Commission: {0}", Symbol.Commission); 34 | Print("Commission Type: {0}", Symbol.CommissionType); 35 | Print("Minimum Commission: {0}", Symbol.MinCommission); 36 | Print("Minimum Commission Asset: {0}", Symbol.MinCommissionAsset); 37 | Print("Minimum Commission Type: {0}", Symbol.MinCommissionType); 38 | Print("Administrative Charge 3 Days Rollover: {0}", Symbol.AdministrativeCharge3DaysRollover); 39 | Print("Administrative Charge: {0}", Symbol.AdministrativeCharge); 40 | Print("Grace Period: {0}", Symbol.GracePeriod); 41 | Print("Swap Long: {0}", Symbol.SwapLong); 42 | Print("Swap Short: {0}", Symbol.SwapShort); 43 | Print("Swap 3 Days Rollover: {0}", Symbol.Swap3DaysRollover); 44 | Print("Swap Calculation Type: {0}", Symbol.SwapCalculationType); 45 | Print("Is Trading Enabled: {0}", Symbol.IsTradingEnabled); 46 | Print("Trading Mode: {0}", Symbol.TradingMode); 47 | Print("Minimum Distance Type: {0}", Symbol.MinDistanceType); 48 | Print("Minimum Take Profit Distance: {0}", Symbol.MinTakeProfitDistance); 49 | Print("Minimum Stop Loss Distance: {0}", Symbol.MinStopLossDistance); 50 | Print("Dynamic Leverage: {0}", string.Join(", ", Symbol.DynamicLeverage.Select(l => l.Leverage))); 51 | Print("Market Hours: {0}", Symbol.MarketHours); 52 | Print("Point Size: {0}", Symbol.TickSize); 53 | Print("Minimum Volume: {0}", Symbol.VolumeInUnitsMin); 54 | Print("Maximum Volume: {0}", Symbol.VolumeInUnitsMax); 55 | Print("Volume Step: {0}", Symbol.VolumeInUnitsStep); 56 | } 57 | 58 | protected override void OnTick() 59 | { 60 | // This method is called on each incoming tick 61 | // You can use it to continuously print or update symbol properties if needed 62 | } 63 | } 64 | } 65 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # all_symbol_data_in_ctrader 2 | Your code effectively retrieves and prints all key properties of the current chart symbol, providing a detailed snapshot of its attributes. The implementation is thorough and organized. Here's a quick review and suggestions for potential enhancements: 3 | 4 | --- 5 | 6 | ### Code Highlights: 7 | 1. **Comprehensive Coverage**: 8 | - Includes nearly all significant properties such as bid/ask prices, pip size, tick size, commission details, and leverage. 9 | 10 | 2. **Dynamic Leverage Handling**: 11 | - Uses `string.Join` to format the dynamic leverage tiers for easier readability. 12 | 13 | 3. **Easy-to-Read Output**: 14 | - Organizes the output with clear property labels and values, making it easy to interpret. 15 | 16 | --- 17 | 18 | ### Suggested Enhancements: 19 | 1. **Add Point Value Calculation**: 20 | - Include a calculated point value using the formula: 21 | ```csharp 22 | double pointValue = Symbol.TickValue / (Symbol.TickSize / Symbol.PipSize); 23 | Print("Point Value: {0}", pointValue); 24 | ``` 25 | 26 | 2. **Handle Missing or Unsupported Data**: 27 | - Wrap prints in a `try-catch` block for properties that might not be supported or initialized for certain symbols: 28 | ```csharp 29 | try 30 | { 31 | Print("PnL Conversion Fee Rate: {0}", Symbol.PnLConversionFeeRate); 32 | } 33 | catch (Exception ex) 34 | { 35 | Print("PnL Conversion Fee Rate is not available: {0}", ex.Message); 36 | } 37 | ``` 38 | 39 | 3. **Real-Time Monitoring**: 40 | - Extend the `OnTick` method to monitor properties like bid, ask, and spread for real-time changes: 41 | ```csharp 42 | protected override void OnTick() 43 | { 44 | Print("Real-Time Bid: {0}, Ask: {1}, Spread: {2}", Symbol.Bid, Symbol.Ask, Symbol.Spread); 45 | } 46 | ``` 47 | 48 | 4. **Filter or Format Output**: 49 | - Include options to filter which properties to display or format the output for cleaner logs: 50 | ```csharp 51 | Print("{0,-30}: {1}", "Property Name", "Value"); 52 | ``` 53 | 54 | 5. **Handle Market Hours Details**: 55 | - Expand `MarketHours` output to display individual trading sessions for more detailed insights: 56 | ```csharp 57 | foreach (var session in Symbol.MarketHours.Sessions) 58 | { 59 | Print("Session: Start - {0}, End - {1}", session.Start, session.End); 60 | } 61 | ``` 62 | 63 | --- 64 | 65 | ### Example Output: 66 | For `EURUSD`, the output might look like: 67 | ``` 68 | Symbol Name: EURUSD 69 | Bid Price: 1.10345 70 | Ask Price: 1.10365 71 | Spread: 0.2 72 | Pip Size: 0.0001 73 | Digits: 5 74 | Tick Size: 0.00001 75 | Minimum Volume in Units: 1000 76 | Maximum Volume in Units: 10000000 77 | Volume Step in Units: 1000 78 | Pip Value: 10.0 79 | Tick Value: 1.0 80 | Lot Size: 100000 81 | Unrealized Net Profit: 0.0 82 | Unrealized Gross Profit: 0.0 83 | Base Asset: EUR 84 | Quote Asset: USD 85 | PnL Conversion Fee Rate: 0.01 86 | Commission: 3.0 87 | Commission Type: Per Million 88 | Minimum Commission: 1.0 89 | Minimum Commission Asset: USD 90 | Minimum Commission Type: Asset 91 | Administrative Charge 3 Days Rollover: Wednesday 92 | Administrative Charge: 0.0 93 | Grace Period: 0 94 | Swap Long: 1.2 95 | Swap Short: -2.5 96 | Swap 3 Days Rollover: Wednesday 97 | Swap Calculation Type: Points 98 | Is Trading Enabled: True 99 | Trading Mode: Spot 100 | Minimum Distance Type: Points 101 | Minimum Take Profit Distance: 5.0 102 | Minimum Stop Loss Distance: 5.0 103 | Dynamic Leverage: 1:30, 1:20 104 | Market Hours: 24/5 105 | Point Size: 0.00001 106 | Minimum Volume: 1000 107 | Maximum Volume: 10000000 108 | Volume Step: 1000 109 | ``` 110 | 111 | This code is already robust, and with these enhancements, it will become even more versatile for detailed symbol analysis or trading decision-making. Let me know if you'd like to extend this further! 112 | --------------------------------------------------------------------------------