Topics
30 Aug 2017, 11:07
 0
 3253
 3
28 Apr 2017, 14:00
 2183
 2
31 Mar 2017, 09:27
 2714
 3
30 Mar 2017, 11:50
 3456
 7
29 Mar 2017, 16:02
 2696
 7
29 Mar 2017, 10:48
 2128
 3
12 Mar 2017, 13:53
 2269
 2
01 Mar 2017, 22:40
 1803
 4
22 Feb 2017, 21:02
 2139
 1
22 Feb 2017, 19:48
 2543
 5
08 Feb 2017, 13:58
 6043
 14
03 Feb 2017, 10:03
 0
 2108
 1
Replies

mindbreaker
11 Sep 2016, 10:10

RE: RE: RE: RE:

Hi

Thank you for your explanation. If however this fix works without SSL it does not interest me such a flawed system.

Thanks for the help

Ps.

I think it display certs info (but maybe on 443 port I see in monday.)

 

        static void DisplayCertificateInformation(SslStream stream)
        {
            Console.WriteLine("Certificate revocation list checked: {0}", stream.CheckCertRevocationStatus);

            X509Certificate localCertificate = stream.LocalCertificate;
            if (stream.LocalCertificate != null)
            {
                Console.WriteLine("Local cert was issued to {0} and is valid from {1} until {2}.",
                    localCertificate.Subject,
                    localCertificate.GetEffectiveDateString(),
                    localCertificate.GetExpirationDateString());
            }
            else
            {
                Console.WriteLine("Local certificate is null.");
            }
            // Display the properties of the client's certificate.
            X509Certificate remoteCertificate = stream.RemoteCertificate;
            if (stream.RemoteCertificate != null)
            {
                Console.WriteLine("Remote cert was issued to {0} and is valid from {1} until {2}.",
                    remoteCertificate.Subject,
                    remoteCertificate.GetEffectiveDateString(),
                    remoteCertificate.GetExpirationDateString());
            }
            else
            {
                Console.WriteLine("Remote certificate is null.");
            }
        }

Nice day


@mindbreaker

mindbreaker
10 Sep 2016, 19:18

RE: RE:

Hi tetra I know but:

1) I dont know how check message body length (Which part)

-The fix message body length is wrong in the example

 

2) Checksum this example:

https://github.com/fxstar/Chash/blob/master/FIX4.4/Checksum.cs

string message = "8=FIX.4.1|9=61|35=A|34=1|49=EXEC|52=20121105-23:24:06|"
    + "56=BANZAI|98=0|108=30|";
message = message.Replace('|', '\u0001');
byte[] messageBytes = Encoding.ASCII.GetBytes(message);
for (int i = 0; i < message.Length; i++)
    total += messageBytes[i];
 
int checksum = total % 256;
string checksumStr = checksum.ToString().PadLeft(3, '0');

 

3) if I check ssl there was on server(multicard ssl)  why i can't use SSL?

 

Thanks for the help

 

tetra said:

Hi mindbreaker,

Few notes about your code:

-The fix message body length is wrong in the example

-The fix message checksum number is also wrong

-Use proper time: /52=/ DateTime.Now.ToUniversalTime().ToString("yyyyMMdd-hh:mm:ss.fff")

-Since there is no ssl, use client.GetStream() directly

-Do not forget to change the separator / .Replace('|', '\u0001') /

if you fix these, your code will work.

 

mindbreaker said:

Hi how connect and get data from server ???

It is my code:

using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Net.Security;
using System.Net.Sockets;
using System.Security.Cryptography.X509Certificates;
using System.Text;
using System.Threading;
using System.Threading.Tasks;

namespace FIX
{
    class Program
    {

        public static string host = "h51.p.ctrader.com";

        static void Main(string[] args)
        {
            while (true)
            {
                StartClient(host);
                Thread.Sleep(5000);
            }
        }

        public static void StartClient(string host)
        {
            // Data buffer for incoming data.
            byte[] bytes = new byte[1024];

            // Connect to a remote device.
            try
            {
               
                IPHostEntry ipHostInfo = Dns.GetHostEntry(host);
                IPAddress ipAddress = ipHostInfo.AddressList[0];
                Console.WriteLine(ipAddress);

                 TcpClient client = new TcpClient(host, 5201);
                SslStream sslStream = new SslStream(client.GetStream(), false, new RemoteCertificateValidationCallback(ValidateServerCertificate), null);
                try
                {
                    sslStream.AuthenticateAsClient(host);
                    //sslStream.AuthenticateAsClientAsync(host);
                }
                catch (Exception e)
                {
                    Console.WriteLine(e);
                    client.Close();
                    return;
                }
                // Connect the socket to the remote endpoint. Catch any errors.
                try
                {

                    byte[] messsage = Encoding.UTF8.GetBytes("8=FIX.4.4|9=102|35=A|34=1|49=fxpro.9910892|50=Quote|52=20131129-15:40:10.276|56=cServer|98=0|108=30|141=Y|553=1047|554=PASSWORD|10=140|");
                    // Send hello message to the server. 
                    sslStream.Write(messsage);
                    sslStream.Flush();

                    // Read message from the server. 
                    string serverMessage = ReadMessage(sslStream);
                    Console.WriteLine("Server says: {0}", serverMessage);

                    //Console.WriteLine("SERVER SEND: {0}", Encoding.ASCII.GetString(bytes, 0, bytesRec));

    
                }
                catch (ArgumentNullException ane)
                {
                    Console.WriteLine("ArgumentNullException : {0}", ane.ToString());
                }
                catch (SocketException se)
                {
                    Console.WriteLine("SocketException : {0}", se.ToString());
                }
                catch (Exception e)
                {
                    Console.WriteLine("Unexpected exception : {0}", e.ToString());
                }

            }
            catch (Exception e)
            {
                Console.WriteLine(e.ToString());
            }
        }
        static string ReadMessage(SslStream sslStream)
        {
            byte[] buffer = new byte[2048];
            StringBuilder messageData = new StringBuilder();
            int bytes = -1;
            do
            {
                bytes = sslStream.Read(buffer, 0, buffer.Length);
                Decoder decoder = Encoding.UTF8.GetDecoder();
                char[] chars = new char[decoder.GetCharCount(buffer, 0, bytes)];
                decoder.GetChars(buffer, 0, bytes, chars, 0);
                messageData.Append(chars);
                Console.WriteLine(chars);
                // Check for EOF. 
                if (messageData.ToString().IndexOf(" ") != -1)
                {
                    break;
                }
            } while (bytes != 0);

            return messageData.ToString();
        }

        // The following method is invoked by the RemoteCertificateValidationDelegate.
        public static bool ValidateServerCertificate(object sender, X509Certificate certificate, X509Chain chain, SslPolicyErrors sslPolicyErrors)
        {
            if (sslPolicyErrors == SslPolicyErrors.None)
                return true;

            Console.WriteLine("Certificate error: {0}", sslPolicyErrors);

            // Do not allow this client to communicate with unauthenticated servers.
            //return false;
            //Force ssl certyfikates as correct
           return true;
        }
    }
}

Thanks for the help

 

 


@mindbreaker

mindbreaker
01 Sep 2016, 20:48

Fix SSL

Thanks

I need example with C# and SSL (Financial app whitout ssl its stupid).

I don't like Java and Android but:

You can show example.

Nice day


@mindbreaker

mindbreaker
01 Sep 2016, 17:54

FIX 4.4 C# SocketSSL

Hi, i try connect to ctrader server with fix but something went wrong.

using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Net.Security;
using System.Net.Sockets;
using System.Security.Cryptography.X509Certificates;
using System.Text;
using System.Threading;
using System.Threading.Tasks;

namespace FIX
{
    class Program
    {

        public static string host = "h51.p.ctrader.com";

        static void Main(string[] args)
        {
            while (true)
            {
                StartClient(host);
                Thread.Sleep(5000);
            }
        }

        public static void StartClient(string host)
        {
            // Data buffer for incoming data.
            byte[] bytes = new byte[1024];

            // Connect to a remote device.
            try
            {
               
                IPHostEntry ipHostInfo = Dns.GetHostEntry(host);
                IPAddress ipAddress = ipHostInfo.AddressList[0];
                Console.WriteLine(ipAddress);

                 TcpClient client = new TcpClient(host, 5201);
                SslStream sslStream = new SslStream(client.GetStream(), false, new RemoteCertificateValidationCallback(ValidateServerCertificate), null);
                try
                {
                    sslStream.AuthenticateAsClient(host);
                    //sslStream.AuthenticateAsClientAsync(host);
                }
                catch (Exception e)
                {
                    Console.WriteLine(e);
                    client.Close();
                    return;
                }
                // Connect the socket to the remote endpoint. Catch any errors.
                try
                {

                    byte[] messsage = Encoding.UTF8.GetBytes("8=FIX.4.4|9=102|35=A|34=1|49=fxpro.123456|50=Quote|52=20131129-15:40:10.276|56=cServer|98=0|108=30|141=Y|553=1047|554=PASSWORD|10=140|");
                    // Send hello message to the server. 
                    sslStream.Write(messsage);
                    sslStream.Flush();

                    // Read message from the server. 
                    string serverMessage = ReadMessage(sslStream);
                    Console.WriteLine("Server says: {0}", serverMessage);

                    //Console.WriteLine("SERVER SEND: {0}", Encoding.ASCII.GetString(bytes, 0, bytesRec));

    
                }
                catch (ArgumentNullException ane)
                {
                    Console.WriteLine("ArgumentNullException : {0}", ane.ToString());
                }
                catch (SocketException se)
                {
                    Console.WriteLine("SocketException : {0}", se.ToString());
                }
                catch (Exception e)
                {
                    Console.WriteLine("Unexpected exception : {0}", e.ToString());
                }

            }
            catch (Exception e)
            {
                Console.WriteLine(e.ToString());
            }
        }
        static string ReadMessage(SslStream sslStream)
        {
            byte[] buffer = new byte[2048];
            StringBuilder messageData = new StringBuilder();
            int bytes = -1;
            do
            {
                bytes = sslStream.Read(buffer, 0, buffer.Length);
                Decoder decoder = Encoding.UTF8.GetDecoder();
                char[] chars = new char[decoder.GetCharCount(buffer, 0, bytes)];
                decoder.GetChars(buffer, 0, bytes, chars, 0);
                messageData.Append(chars);
                Console.WriteLine(chars);
                // Check for EOF. 
                if (messageData.ToString().IndexOf(" ") != -1)
                {
                    break;
                }
            } while (bytes != 0);

            return messageData.ToString();
        }

        // The following method is invoked by the RemoteCertificateValidationDelegate.
        public static bool ValidateServerCertificate(object sender, X509Certificate certificate, X509Chain chain, SslPolicyErrors sslPolicyErrors)
        {
            if (sslPolicyErrors == SslPolicyErrors.None)
                return true;

            Console.WriteLine("Certificate error: {0}", sslPolicyErrors);

            // Do not allow this client to communicate with unauthenticated servers.
            //return false;
            //Force ssl certyfikates as correct
           return true;
        }
    }
}

And the question: How fix my example ?

Thanks


@mindbreaker

mindbreaker
27 May 2016, 10:37

RE:

This post was removed by moderator.

 


@mindbreaker

mindbreaker
18 May 2016, 21:36

RE:

Witaj, poszukaj (/algos/indicators).

Proponuje graj na stałe poziomy (week open level, 100pips levels 500pips levels do tego jakieś małe MA 20 - 50 (m5 - m30) a nie na zmienne jak fibo, czy suport i resistance.

Rzadziej zmieniasz pozycje tym więcej zarabiasz, (raczej target w zysk 500 pips nie 50 i pary z setkami pips w tygodniu).

Miłego.

 

 


@mindbreaker

mindbreaker
28 Apr 2016, 08:57

FIX4.4

This post has been removed by moderator due to a violation of the EULA. Broker discussions are prohibited in cTDN.

 


@mindbreaker

mindbreaker
27 Apr 2016, 20:36

FIX4.4

Java example with quickfix

http://www.dailyfxforum.com/threads/64877-Quickfix-Java-Example


@mindbreaker

mindbreaker
27 Apr 2016, 20:17

FIX

I found this

http://quickfixn.org/tutorial/creating-an-application.html

http://www.quickfixengine.org/

and

http://quickfixn.org/tutorial/creating-an-application.html

https://ttfixadapter.codeplex.com/

 

and java

http://www.quickfixj.org/quickfixj/usermanual/1.6.1/usage/sending_messages.html

https://mprabhat.me/2012/07/02/creating-a-fix-initiator-using-quickfixj/

http://vvratha.blogspot.com/2012/06/writing-simple-fix-initiator-and.html

 

and php

http://stackoverflow.com/questions/7002774/getting-started-on-fix-protocol-with-php-sockets


@mindbreaker

mindbreaker
27 Apr 2016, 17:06

RE: Spotware

Did any of cTrader/cAlgo broker allows use of FIX 4.4 Protocol ?


@mindbreaker

mindbreaker
27 Apr 2016, 14:33

Spotware

Spotware said:

Dear Trader,

Please have a look at the Code Samples given at the the Spotware Connect site.

Dear Spotware

there no FIX examples.

Please send link with working example with FIX 4.4

Bye.

 


@mindbreaker

mindbreaker
20 Apr 2016, 13:41

cmirror

Screenshots : ROI shows error values !!! no answer !!! (Tooday i have 30% but your stupid ROI shows 4%)

and here is another:

/forum/cmirror-support/7947

And there no button on bottom of the thread for unsubscribe.

And why you open your page after close cTrader platform on spotware demo

 


@mindbreaker

mindbreaker
20 Apr 2016, 09:33

Fake equity -> ROI

Hi Spotware

When You delete this tabs from cmirror ROI (%) and ROI(USD) - never show correct values (In mt4, mql5 signals works everything as it should be)?

Set equity and balance tabs on first position and do not make a fool of playing and copying.

Set account equity like profit from signal not ROI (ROI shows 50% when signal loses capital and is -50%).

Bye.

And dont spam you send this stupid mails when someone add post to thread (When i can stop this or when i can unsubscribe it)?

And why you open your page after close cTrader platform on spotware demo?

 


@mindbreaker

mindbreaker
21 Mar 2016, 16:16

Mail

Hi, email will be active only in this month (see in profil)

 


@mindbreaker

mindbreaker
21 Mar 2016, 08:34

This post was removed by moderator.


@mindbreaker

mindbreaker
11 Mar 2016, 09:40

cBots examples

Hej,

raczej nic lepszego niż pozycje oczekujące co n pips od tygodniówki w górę lub w dół nie wymyślisz :) (chyba za słaba platforma "może na dobrym klastrze", nie wspominając o A.I. Artificial Intelligence) na parach gdzie w tygodniu jest kilka setek (DJI, GBPJPY, GBPAUD ... nawet po stracie jest szansa na odegranie się w tygodniu)

Aczkolwiek próbować zawsze można ;)

Pozdrawiam i powodzenia.

P.s co do wskazówek nie ma przymusu korzystać :)


@mindbreaker

mindbreaker
10 Mar 2016, 21:35

cBots examples

Hej, tutaj sobie zerknij:

https://github.com/breakermind/cAlgoRobotsIndicators/blob/master/oooDBoo

a tutaj inne roboty

https://github.com/breakermind/cAlgoRobotsIndicators

Aczkolwiek czasu lepiej nie marnuj i "jepnij" pendingi co 100 Pips od 500 pips levels i czekaj :) ( maksymalnie 0.01 z 100$  najlepiej bez stop losów się gra jak stawiasz stop losa i dotego jeszcze małego to murowana strata) (z "ujem" nie wygrasz jak będziesz się ganiał po 50 pipsów  a tak coś zarobisz)

lub

pozycja nad lub pod week open price level i czekaj do końca tygodnia (popatrz ile jest pipsów od startu do końca tygodnia)

Week open wskaźnik https://github.com/breakermind/cAlgoRobotsIndicators/blob/master/_WeekOpen500_100Pips_Indicator.cs

Wskaźniki do cAlgo, mt4, jforex (po lewej stronie link)

https://twitter.com/fxstarforex

Miłego marnowania czasu

 


@mindbreaker

mindbreaker
29 Feb 2016, 11:11 ( Updated at: 21 Dec 2023, 09:20 )

chart


@mindbreaker

mindbreaker
24 Feb 2016, 14:55

:)

So what ilpoj,

if there was no need to wonder.

Better earn 10 000$ than 2 000$ (doing nothing and not guarding anything).

You're wasting your time like I used to. If you set positions only on levels of 500 pips (you've got to think very rarely - especially eurusd, a currency for slowpoke )

In this week only 3 days i earn only 2 500$  on 1 lot.

Have a nice day.

 

 


@mindbreaker

mindbreaker
24 Feb 2016, 09:57 ( Updated at: 21 Dec 2023, 09:20 )

Strategy contest 300% bots - https://www.dukascopy.com/strategycontest/?language=pl

Hi, in this period (your backtest)

one position 30 000 account 1000$ earn this:

Why write a robot so earns less than one position ???? (You can add pendings every 500 pips and earn much more)

In your cbot More broker earnings than you.

 

 


@mindbreaker