Topics
12 Mar 2024, 11:00
 0
 340
 0
10 Mar 2024, 20:53
 434
 1
Replies

jani
10 Mar 2024, 22:43

Sorry could not find the way to delete this thread. I solved the issue already. It was a problem with:
 

new CustomIndicatorLibrary.Class1.KAMA.Parameters

just needed to remove the "Parameters" and simplify the syntax

 

 

 

 


@jani

jani
03 Mar 2024, 20:27 ( Updated at: 04 Mar 2024, 06:32 )

RE: Use AI help your cTrader coding

PanagiotisChar said: 

Hi all,

My personal experience is that ChatGPT is not there yet when it comes to cTrader Automate. Most of the times, the generated code is nonsense, it does not build and it's misleading.

Aieden Technologies

Need help? Join us on Telegram

Need premium support? Trade with us

 

Hi Panagiotis,

LLMs and AI/machine learning are growing an incredible exponential speed. Chat GPT 4 today is much more able to handle cAlgo than it was a couple of months ago.
I have personally started a custom  GPT project named: "cTrader cAlgo Navigator". My goal is to build ChatGPT 4 plugin to write cAlgo code using all available resources. I'm planning to publish this plugin for general use as soon as I have managed to teach it the necessary knowledge and to prompt engineer it for optimal performance. For this project, I would need to start with the first step of Dataset Compilation which would consist of:


1) Collect Code Samples: Gather a diverse set of C# code samples specifically used in cBots and indicators within cAlgo/cTrader. This collection should include examples ranging from simple indicators to complex trading bots employing various trading strategies.

2) Incorporate Documentation: Include official cAlgo/cTrader API documentation excerpts, tutorials, and community-contributed code snippets. This ensures the model learns from authoritative and practical sources.

3) Annotate for Context: Annotate code samples with explanations of their functionality, the trading strategy they implement, and any cAlgo/cTrader-specific features they use. Annotations should be clear and concise, aiding the model in understanding the purpose and context of each code block.

 

Is there any way you could help we to gather the above-mentioned information? I believe JSON format would be a good way to input this data to the GPT.


@jani

jani
03 Mar 2024, 20:10

Sounds interesting!

Your project sounds interesting! I have personally started a ChatGPT custom  GPT project named: "cTrader cAlgo Navigator". My goal is the customize GPT to code cAlgo with using all available resources. I think the type of market analysis you're talking about could very well be integrated into the same GPT or a separate GPT that complements the coding side = one GPT concentration on creating trading strategy and the other on algo execution.


@jani

jani
24 Feb 2024, 12:42 ( Updated at: 03 Mar 2024, 20:12 )

...

 …deleted…

 

 


@jani

jani
24 Feb 2024, 12:42

RE: Use AI help your cTrader coding

matfx said: 

I have a look at it and what i can say is the AI not yet efficiently gives the ctrader programming ability, because the code it provide still need to correct manually.

Hi,

I'm not a programmer but have some ability to read and create cAlgo code.

I'd be really interested to hear and share ideas on using AI/GPT/LLM to write, analyze and debug cAgo code. Things are moving super fast in 2024, so what seem now unfeasible might be doable in a months time.

 

 


@jani

jani
27 Feb 2023, 12:31

RE: RE: RE: RE: RE:Impulse MACD

Anyone interested in cTrader version of Impuse MACD can contact me at Telegram: @Fibonacci2011 

 


@jani

jani
24 Feb 2023, 12:25

RE: RE: RE:Impulse MACD

jamesgreenhalgh435 said:

jani said:

jamesgreenhalgh435 said:

Hi is Impulse MACD by lazybear available on cTrade platform.  I would like an indicator to show me when market is ranging and not to open trade. Thanks

Hi,

 

I'm also interested of developing this indicator for cTrader. I can code some, but we could co-op and hire a programmer. Let me know if you're interested.

Hi thanks for responding to the subject in hand. I have been using Directional movement system in the cTrader indicators that works quite well for showing strong and weak trends. I also would like it if there was a MACD crossover Cbot and I can only find it from a different programmer and clickalgo don't do it yet. Thanks

Just finished Impulse MACD indicator for cTrader. Had to use some help as could not understand  TradingView code, but now it is working well


@jani

jani
21 Feb 2023, 01:08

RE:

jamesgreenhalgh435 said:

Hi is Impulse MACD by lazybear available on cTrade platform.  I would like an indicator to show me when market is ranging and not to open trade. Thanks

Hi,

 

I'm also interested of developing this indicator for cTrader. I can code some, but we could co-op and hire a programmer. Let me know if you're interested.


@jani

jani
16 Feb 2023, 00:16 ( Updated at: 17 Feb 2023, 19:02 )

RE:

Hello,

is there any way to delete/remove the new indicator panels? They interfere every with TP and SL adjustments..

 


@jani

jani
14 Nov 2022, 17:40

RE:

Hi Panagiotis,

 

thank you for your help!

I had to do some reinstalling and decided to go forward with VS 2019. Seems to work fine.


@jani

jani
11 Nov 2022, 19:41 ( Updated at: 21 Dec 2023, 09:23 )

"Compatible Visual Studio not found"

I have a project for which I do not remember the VS version I used to build it. How can I check the version? I assume that the project built with VS 2017 does not work with VS 2019? 

I also installed VS 2017 and got the same message below:

 

Also is there a way to control which VS version ctrader is using when opening projects? (assuming several VS versions are installed on computer)

:============================= Log File =========================

11/11/2022 19.47.17 - Microsoft VSIX Installer
11/11/2022 19.47.17 - -------------------------------------------
11/11/2022 19.47.17 - vsixinstaller.exe version:
11/11/2022 19.47.17 - 17.4.2118-17-4P4Inse-ge4c88902
11/11/2022 19.47.17 - -------------------------------------------
11/11/2022 19.47.17 - Command line parameters:
11/11/2022 19.47.17 - C:\Program Files (x86)\Microsoft Visual Studio\Installer\resources\app\ServiceHub\Services\Microsoft.VisualStudio.Setup.Service\VSIXInstaller.exe,C:\Users\janiv\AppData\Local\Spotware\cTrader\10fecce7a7f3fca4b010a0d21af6a30a\app_4.2.22.8454\VSExtension.vsix
11/11/2022 19.47.17 - -------------------------------------------
11/11/2022 19.47.17 - Microsoft VSIX Installer
11/11/2022 19.47.17 - -------------------------------------------
11/11/2022 19.47.18 - Skipping product Microsoft.VisualStudio.Product.TestAgent (9e161c2a) since it does not support extensions
11/11/2022 19.47.18 - Skipping product Microsoft.VisualStudio.Product.TestAgent (b6997afd) since it does not support extensions
11/11/2022 19.47.18 - Initializing Install...
11/11/2022 19.47.19 - Extension Details...
11/11/2022 19.47.19 -     Identifier         : 2c72cc50-6c69-4b16-b1f4-ab470673f284
11/11/2022 19.47.19 -     Name               : cBots and Custom Indicators
11/11/2022 19.47.19 -     Author             : Spotware
11/11/2022 19.47.19 -     Version            : 1.9
11/11/2022 19.47.19 -     Description        : Building cBots and Custom Indicators in Visual Studio
11/11/2022 19.47.19 -     Locale             : en-US
11/11/2022 19.47.19 -     MoreInfoURL        : 
11/11/2022 19.47.19 -     InstalledByMSI     : False
11/11/2022 19.47.19 -     SupportedFrameworkVersionRange : [0.0,2147483647.2147483647]
11/11/2022 19.47.19 - 
11/11/2022 19.47.19 -     SignatureState     : Unsigned
11/11/2022 19.47.19 -     Supported Products : 
11/11/2022 19.47.19 -         Microsoft.VisualStudio.Pro
11/11/2022 19.47.19 -             Version : [11.0,17.0)
11/11/2022 19.47.19 -             ProductArchitecture : x86
11/11/2022 19.47.19 - 
11/11/2022 19.47.19 -     References         : 
11/11/2022 19.47.19 -     Prerequisites      : 
11/11/2022 19.47.19 -         -------------------------------------------------------
11/11/2022 19.47.19 -         Identifier   : Microsoft.VisualStudio.Component.CoreEditor
11/11/2022 19.47.19 -         Name         : Visual Studio core editor
11/11/2022 19.47.19 -         Version      : [15.0,)
11/11/2022 19.47.19 - 
11/11/2022 19.47.19 - Signature Details...
11/11/2022 19.47.19 -     Extension is not signed.
11/11/2022 19.47.19 - 
11/11/2022 19.47.19 - Searching for applicable products...
11/11/2022 19.47.19 - Found installed product - Global Location
11/11/2022 19.47.19 - Found installed product - Visual Studio Community 2022
11/11/2022 19.47.19 - VSIXInstaller.NoApplicableSKUsException: This extension is not installable on any currently installed products.
   at VSIXInstaller.ExtensionService.GetInstallableDataImpl(IInstallableExtension extension, String extensionPackParentName, Boolean isRepairSupported, IStateData stateData, IEnumerable`1& skuData)
   at VSIXInstaller.ExtensionService.GetInstallableData(String vsixPath, String extensionPackParentName, Boolean isRepairSupported, IStateData stateData, IEnumerable`1& skuData)
   at VSIXInstaller.ExtensionPackService.IsExtensionPack(IStateData stateData, Boolean isRepairSupported)
   at VSIXInstaller.ExtensionPackService.ExpandExtensionPackToInstall(IStateData stateData, Boolean isRepairSupported)
   at VSIXInstaller.App.Initialize(Boolean isRepairSupported)
   at VSIXInstaller.App.Initialize()
   at System.Threading.Tasks.Task`1.InnerInvoke()
   at System.Threading.Tasks.Task.Execute()
 

 

 


@jani

jani
23 Jan 2022, 23:40

Small correction to the the sample code

Thanks for all the good code.

 

I noticed a small logic error.

You should have:

  if (position.EntryTime.AddMinutes(CloseTimeInMinutes) <= currentTime && position.NetProfit >= Profit)

Instead of:

  if (position.EntryTime.AddMinutes(CloseTimeInMinutes) >= currentTime && position.NetProfit >= Profit)

This way position is closed when server time passes the position entry time + added minutes. and  profit is greater than the set threshold.


@jani

jani
21 Jan 2022, 11:30 ( Updated at: 21 Jan 2022, 12:08 )

RE:

Hi Panagiotis,

 

I think one of the  problems was that the code was printing on every index into the log file and that  took a long time to run.

I changed the code so that print would just activate at the end and used BarsToLoad = 70 000

 

     while (Bars.Count < BarsToLoad)
            {
                var loadedCount = Bars.LoadMoreHistory();
             
                if (loadedCount == 0)
                    break;
            }
    if (Bars.Count >= BarsToLoad)Print("  ||  Bar count: ", Bars.Count, "  ||  Index: ", index);

I'm still getting the same increase in CPU usage. I uploaded a video about the code running on Pepperstone , link below:

Also cannot figure out what is the purpose of "loadedCount" as it seems to always return 0?


@jani

jani
13 Jan 2022, 13:00

RE:

Hi Panagiotis,

Symbol: EURUSD, TF: 1H  Broker: IC Markets. Also used other symbols like XAUUSD with same results

Br,

Jani

 

 


@jani

jani
11 Jan 2022, 12:04

RE: RE: Code is crashing cTrader

Hi,

thanks for the reply.  

I tried with different values for Bars.Count from 500 to 2000 and it seems to get  my computer stuck and takes cTrader CPU usage from the normal 7-20% to over 50% ( I have Windows 10, Intel i5-7600 CPU and 32 GB RAM)

My total bars on H1 after the code is done is over 70 000, so the issue should not be an infinite loop due to insufficient history bars.

 

amusleh said:

jani said:

Hello,

 

I tried to use below in an indicator:

Print("{0} bar on the chart. Loading 10 000 bars", Bars.Count);
while (Bars.Count < 10000)
{
    var loadedCount = Bars.LoadMoreHistory();
    Print("Loaded {0} bars", loadedCount);
    if (loadedCount == 0)
        break;
}
Print("Finished, total bars {0}", Bars.Count);

and it practically crashed my cTrader every time I compiled the code while the indicator was attached to a 1H chart.

Hi,

I just tested your code on Spotware cTrader beta for EURUSD and GBPUSD H1 and it worked fine.

But there is an issue with your code, what if the symbol doesn't have that number of bars? then you will end up with an infinite loop which will crash your cTrader.

You don't know how many bars are available, so if you use a fixed number and symbol doesn't had that number of bars then it will crash your platform.

 


@jani

jani
10 Jan 2022, 20:08

Code is crashing cTrader

Hello,

 

I tried to use below in an indicator:

Print("{0} bar on the chart. Loading 10 000 bars", Bars.Count);
while (Bars.Count < 10000)
{
    var loadedCount = Bars.LoadMoreHistory();
    Print("Loaded {0} bars", loadedCount);
    if (loadedCount == 0)
        break;
}
Print("Finished, total bars {0}", Bars.Count);

and it practically crashed my cTrader every time I compiled the code while the indicator was attached to a 1H chart.


@jani

jani
08 Apr 2020, 19:49

RE: Simple and robust trailing algorithm

Thanks for sharing your code. Have you checked that this code works?

Initially, I wanted to add "Step" to the trailing stop to determine the minimum distance price has to move in favour of the position for the trailing stop to be adjusted. This is just to save resources in case adjusting  SL on every tick is not necessary. 

 

 


@jani

jani
11 Mar 2020, 23:55

 

 

 

 


@jani

jani
09 Mar 2020, 10:54

RE:

Thank you Panagiotis,

This was very helpful!


@jani

jani
09 Mar 2020, 00:05 ( Updated at: 21 Dec 2023, 09:21 )

Problems with substitutions

I'm still having issues with substituting new API definitions. I tried to do exactly as the warning messages direct, but still unable to find the correct format and getting error messages.

I have:

using System;
using cAlgo.API;
using cAlgo.API.Internals;
using cAlgo.API.Indicators;
using cAlgo.Indicators;


namespace cAlgo.Indicators
{

    [Indicator(IsOverlay = true, TimeZone = TimeZones.UTC, AccessRights = AccessRights.None)]
    public class HighestHighLowestLow2 : Indicator
    {

        [Parameter(" Period", DefaultValue = 10, MinValue = 1)]
        public int Period { get; set; }

        [Parameter(" Timeframe")]
        public TimeFrame AnotherTimeFrame { get; set; }

        [Output("Close Up", LineColor = "Red")]
        public IndicatorDataSeries CloseUp { get; set; }

        [Output("High", LineColor = "Pink")]
        public IndicatorDataSeries High { get; set; }

        [Output("Close Down", LineColor = "Blue")]
        public IndicatorDataSeries CloseDown { get; set; }

        [Output("Low", LineColor = "Aqua")]
        public IndicatorDataSeries Low { get; set; }

        public MarketSeries dataseries;
        // public Bars dataseries;

        protected override void Initialize()
        {

            dataseries = MarketData.GetSeries(Symbol, AnotherTimeFrame);
            // dataseries = MarketData.GetBars(Symbol, AnotherTimeFrame);
        }

        public override void Calculate(int index)
        {
            // Top[index] = MarketSeries.High.Maximum(PeriodsHigh);
            //Bottom[index] = MarketSeries.Low.Minimum(PeriodsLow);

            High[index] = dataseries.High.Maximum(Period);
            //High[index] = dataseries.Bars.HighPrices.Maximum(Period);

            CloseUp[index] = dataseries.Close.Maximum(Period);
            CloseDown[index] = dataseries.Close.Minimum(Period);
            Low[index] = dataseries.Low.Minimum(Period);
        }
    }
}

I'm getting warnings:

For example if I change 

public MarketSeries dataseries;

to

 public Bars dataseries;

as the instruction says, I get an error:

 

Sorry to trouble with a similar issue, but I believe I'm not alone here with these 3.7 API substitution troubles...?

 


@jani