B4.2 not fully interoperable with 4.1

Created at 08 Apr 2022, 09:55
How’s your experience with the cTrader Platform?
Your feedback is crucial to cTrader's development. Please take a few seconds to share your opinion and help us improve your trading experience. Thanks!
GA

galafrin

Joined 26.01.2013

B4.2 not fully interoperable with 4.1
08 Apr 2022, 09:55


Beta 4,2 needs to be fully interoperable with 4.1 as far as evaluation is a concern,  but 4.2 compiles solutions targeting 4.1 with a 4.2 GUID mark instead of a 4.1 GUID mark. The outcome is preventing 4.1 to compile a solution compiled from 4.2 because GUID 4.2  is unrecognized by 4.1. 

Once a solution is compiled from 4.2 targeting 4.1, compiling from 4.1 is prevented because of the above reason.. While in Beta,  solutions must still be granted full access under 4.1.

 


@galafrin
Replies

amusleh
08 Apr 2022, 11:14

Hi,

It's not a GUID problem, cTrader 4.2 uses new SDK style projects and cTrader 4.1 uses old legacy style projects, these two aren't compatible with each other.

Here is an example of cTrader 4.2 .NET framework cBot project file:

<?xml version="1.0" encoding="utf-8"?>
<Project Sdk="Microsoft.NET.Sdk">
  <PropertyGroup>
    <TargetFramework>net40</TargetFramework>
  </PropertyGroup>
  <ItemGroup>
    <PackageReference Include="cTrader.Automate" Version="1.*" />
  </ItemGroup>
</Project>

And cTrader 4.1 cBot project file:

<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
  <Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
  <PropertyGroup>
    <LangVersion>7.2</LangVersion>
    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
    <ProjectGuid>{14F07D19-11D3-4FAC-A0A8-22E8C4850A8B}</ProjectGuid>
    <ProjectTypeGuids>{DD87C1B2-3799-4CA2-93B6-5288EE928820};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
    <OutputType>Library</OutputType>
    <AppDesignerFolder>Properties</AppDesignerFolder>
    <RootNamespace>cAlgo</RootNamespace>
    <AssemblyName>Data Tester</AssemblyName>
    <TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
    <TargetFrameworkProfile>Client</TargetFrameworkProfile>
    <FileAlignment>512</FileAlignment>
    <CheckForOverflowUnderflow>True</CheckForOverflowUnderflow>
  </PropertyGroup>
  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
    <DebugSymbols>true</DebugSymbols>
    <DebugType>full</DebugType>
    <Optimize>false</Optimize>
    <OutputPath>bin\Debug\</OutputPath>
    <DefineConstants>DEBUG;TRACE</DefineConstants>
    <ErrorReport>prompt</ErrorReport>
    <WarningLevel>4</WarningLevel>
  </PropertyGroup>
  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
    <DebugType>pdbonly</DebugType>
    <Optimize>true</Optimize>
    <OutputPath>bin\Release\</OutputPath>
    <DefineConstants>TRACE</DefineConstants>
    <ErrorReport>prompt</ErrorReport>
    <WarningLevel>4</WarningLevel>
  </PropertyGroup>
  <ItemGroup>
    <Reference Include="System" />
    <Reference Include="System.Core" />
    <Reference Include="System.Xml.Linq" />
    <Reference Include="System.Data.DataSetExtensions" />
    <Reference Include="System.Data" />
    <Reference Include="System.Xml" />
    <Reference Include="cAlgo.API, Version=1.0.0.0, Culture=neutral, PublicKeyToken=3499da3018340880, processorArchitecture=MSIL">
      <SpecificVersion>False</SpecificVersion>
      <HintPath>..\..\..\..\API\cAlgo.API.dll</HintPath>
    </Reference>
  </ItemGroup>
  <ItemGroup>
    <Compile Include="Data Tester.cs" />
    <Compile Include="Properties\AssemblyInfo.cs" />
  </ItemGroup>
  <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
  <!-- To modify your build process, add your task inside one of the targets below and uncomment it. 
       Other similar extension points exist, see Microsoft.Common.targets.
  <Target Name="BeforeBuild">
  </Target>
  <Target Name="AfterBuild">
  </Target>
  -->
</Project>

cTrader 4.2 can use and build cTrader 4.1 cBots/Indicators, but cTrader 4.1 can't.


@amusleh

galafrin
08 Apr 2022, 15:56 ( Updated at: 08 Apr 2022, 16:58 )

Your answer does not adress algos barred from compile under 4.1 after being compiled under 4.2. It might be solved by calling  4.1 XML snippet from 4.2,  not its 4.2 version.

Actualy all algos complied under 4.2 must be re-sourced from scratch under 4.1 in order to compile. 

Actually compiling under 4.2 targeting 4.1  brings this csprojj XML. This denied when compiling under 4.1. 

<?xml version="1.0" encoding="utf-8"?>
<Project Sdk="Microsoft.NET.Sdk">
  <PropertyGroup>
    <TargetFramework>net6.0</TargetFramework>
    <EnableDefaultItems>False</EnableDefaultItems>
    <GenerateAssemblyInfo>False</GenerateAssemblyInfo>
  </PropertyGroup>
  <PropertyGroup>
    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
    <AppDesignerFolder>Properties</AppDesignerFolder>
    <RootNamespace>cAlgo</RootNamespace>
    <AssemblyName>MA recursive auto</AssemblyName>
    <FileAlignment>512</FileAlignment>
  </PropertyGroup>
  <ItemGroup>
    <PackageReference Include="cTrader.Automate" Version="1.*" />
  </ItemGroup>
  <ItemGroup>
    <Compile Include="MA recursive auto.cs" />
    <Compile Include="Properties\AssemblyInfo.cs" />
  </ItemGroup>
  <ItemGroup>
    <ProjectReference Include="..\..\MA linear auto\MA linear auto\MA linear auto.csproj">
      <Project>{1311DA0C-AFD6-4D41-A94F-A2BC918F3EA1}</Project>
      <Name>MA linear auto</Name>
    </ProjectReference>
  </ItemGroup>
  <ItemGroup>
    <Reference Include="userClasses, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null">
      <HintPath>..\..\userClasses\userClasses\userClasses\userClasses\userClasses\bin\Debug\userClasses.dll</HintPath>
    </Reference>
  </ItemGroup>
</Project>

 


@galafrin

amusleh
08 Apr 2022, 18:15

RE:

Hi,

As I said on my first post, the cBots/indicators that are compiled in cTrader 4.2 is not compatible with cTrader 4.1, the compatibility is one side, you can build cTrader 4.1 indicators/cBots on cTrader 4.2 but not vice versa.

 


@amusleh