Replies

Yasen
27 Dec 2014, 21:24 ( Updated at: 21 Dec 2023, 09:20 )

Please explain why this differences can happen.

FxPro cTrader and Spotware Systems Ltd cTrader drawing different charts on same symbol / timeframe


@Yasen

Yasen
02 Jul 2014, 13:57

You can put labels to your orders and then in OnTick check all your opened positions so you will not open orders on every tick


@Yasen

Yasen
18 Jun 2014, 03:24

Backtesting is a simulator to test your strategy. And each backtesting is a separate process - you can not open a position in one cBot and close it in an another one ( not like in real execution) - In real execution all cBots work together. In real life you for sure can open a position an one cBot and close it in another one even if each cBot runs on a separate computer (using same account for sure) ..... So if you like to backtest a set of cBots together you can copy each cBots code to a single new cBot and then backtest this new cBot to test all cBots together.... "It Can Be Only One"


@Yasen

Yasen
23 May 2014, 10:31

Thank you for reply... Sure I am stopping the timer.... I use the Timer for not allowing sending more than one e-mail in a minute... Timers can not work correctly in backtesting... Even if you will provide us with cAlgo Timers... The problem that I see is not that the timer continue to run after the Stop button pushed - but that if I push Play and Stop many times memory will be reserved and never released.... My timer example just proofed that. Because it's not just about the running timer - but it is about the nTrap variable the one reserved for each process...   

I have bad behavior while programming I change many little things - may be not important things - and always running the program to test the software - One day I started and stopped my cBot more than 256 times (know exactly - because each time I started the cBot - made it send me an email - and the SMTP server does not allow more than 255 e-mails a day....) .... So once in a while it's not bad in my situation to restart the cAlgo... One time it became very slow responding to the Stop button. - restarting helped...

Each time I push Play to start the cBot you will have new memory reserved for all my variables including this one "double Matrix[20,20]" - and it will be never released on pushing Stop...

Please investigate bug 2 - not bug 3

And one more question base.OnStop I do not remember myself from where I copied it - Do I need to use it? and what does it do?

Thank you

   


@Yasen

Yasen
23 May 2014, 02:52

Dear cAlgo developers....

I love your system... even if it is not perfect yet.... Please fix the following 3 bugs:

Bug 1: (Not Important) If you edit some code and then rename it without saving before rename - All changes you did will be lost...

Bug 2: (Important) Each time you run a cBot (pushing play) and stopping it (pushing stop) - (or) running  a backtesting ... a process created and memory reserved - and after finish - memory not released (this can explain a the memory leakage)....

Bug 3: (Proof of Bug 2 and actually funny ) - try Starting and Stopping this code several times - and you will have - as many processes working same time - appending a Log file - even if you stopped the execution... These processes will be alive till you exit cAlgo... (in case of backtesting - meanness but also do the trick....

using System;
using cAlgo.API;
using System.IO;
using System.Timers;

namespace cAlgo.Robots
{
    [Robot(TimeZone = TimeZones.RussianStandardTime)]

    public class Bug : Robot
    {
        protected int nTrap;
        protected String text;
        protected StreamWriter _fileWriter3;
        protected readonly Timer _Timer = new Timer();
        protected override void OnStart()
        {
            nTrap = 0;
            _Timer.Elapsed += OnTimedEvent;
            _Timer.Interval = 1000;
            _Timer.Enabled = true;
            _Timer.Start();
        }
        protected override void OnTick()
        {
            nTrap = 0;
        }
        protected override void OnStop()
        {
            base.OnStop();
            //          _Timer.Stop();
        }
        protected void OnTimedEvent(object sender, ElapsedEventArgs e)
        {
            nTrap++;
            text = Convert.ToString(Server.Time) + " / " + Convert.ToString(nTrap);

            try
            {
                _fileWriter3 = File.AppendText("s:/2.txt");
                _fileWriter3.WriteLine(text);
                _fileWriter3.AutoFlush = true;
                _fileWriter3.Close();
            } catch
            {
            }
        }
    }
}

1 Question : why Server.Time not always go forward? sometimes it's go back in time for some secs... 

1 Request - ability to restart just one cBot on starting cAlgo.... Do not let me waste time programming some autostart program one will move the mouse to some coordinates and click the play button.... 

Thank you for great work.

Yasen


@Yasen

Yasen
14 May 2014, 12:51

Same situation after an update - changing      ModifyPosition(position, SL, TP); to  ModifyPositionAsync(position, SL, TP); worked like charm...
                              


@Yasen