Topics
30 Aug 2017, 11:07
 0
 3465
 3
28 Apr 2017, 14:00
 2348
 2
31 Mar 2017, 09:27
 2890
 3
30 Mar 2017, 11:50
 3666
 7
29 Mar 2017, 16:02
 2885
 7
29 Mar 2017, 10:48
 2262
 3
12 Mar 2017, 13:53
 2412
 2
01 Mar 2017, 22:40
 1947
 4
22 Feb 2017, 21:02
 2281
 1
22 Feb 2017, 19:48
 2696
 5
08 Feb 2017, 13:58
 6299
 14
03 Feb 2017, 10:03
 0
 2224
 1
Replies

mindbreaker
02 Nov 2015, 11:42 ( Updated at: 02 Nov 2015, 22:10 )

RE:

Ale badziew !!!


@mindbreaker

mindbreaker
01 Nov 2015, 12:51

RE: RE:

On linux go to jForex API in Java

https://www.dukascopy.com/swiss/pl/forex/api/jforex_api/

Bye.


@mindbreaker

mindbreaker
01 Nov 2015, 12:45

RE:

Hello,
Do not waste your time on Linux.
Cheap VPS Servers with Windows Server 2012 and 2008 with remote desktop (I have this: VPS CLOUD 1):

https://www.ovh.pl/vps/vps-cloud.xml

or dedicated:

https://www.kimsufi.com/pl/

Nice day.


@mindbreaker

mindbreaker
09 Sep 2015, 14:17

RE:

This post was removed by moderator.

 


@mindbreaker

mindbreaker
15 Aug 2015, 15:51

RE:

Spotware said:

Dear Trader,

Does it work and is it production ready ?

Open API is in production state since June of 2013.

Does it connect to the Broker cTrader server?

It is connected to any cTrader supported broker.

Hello,

Is there somewhere a simple example of how the connect, set and close position using the API?

Only C # and SSL connection via socket with json  (without this strange protocol from googl)?

Simple connect, send command (json) and receive a response like json?

Have a nice day.


@mindbreaker

mindbreaker
27 May 2015, 15:36

RE:

mindbreaker said:

And in regression indicator there is https://github.com/breakermind/cAlgoRobotsIndicators/blob/master/Regression2000.Indicator:

Have this values: sql sqh You can use it in cBot

        [Parameter(DefaultValue = 3.0, MinValue = 1, MaxValue = 4)]
        public int degree { get; set; }
 
        [Parameter(DefaultValue = 2000)]
        public int period { get; set; }
 
        [Parameter(DefaultValue = 1.7)]
        public double strdDev { get; set; }
 
        [Output("PRC", Color = Colors.Gray, LineStyle = LineStyle.Lines)]
        public IndicatorDataSeries prc { get; set; }
 
        [Output("SQH", Color = Colors.Red, LineStyle = LineStyle.Lines)]
        public IndicatorDataSeries sqh { get; set; }
 
        [Output("SQL", Color = Colors.DodgerBlue, LineStyle = LineStyle.Lines)]
        public IndicatorDataSeries sql { get; set; }

 

 

in cBot

        protected override void OnStart()
        {

            //How to Use custom indicator
            cog = Indicators.GetIndicator<Regression>(RegDegree, RegPeriod, RegStrdDev);
        }
 
        protected override void OnTick()
        {
            double up = cog.sqh.LastValue;
            double zero = cog.prc.LastValue;
            double dn = cog.sql.LastValue;
}

 


@mindbreaker

mindbreaker
27 May 2015, 15:34

And in regression indicator there is https://github.com/breakermind/cAlgoRobotsIndicators/blob/master/Regression2000.Indicator:

Have this values: sql sqh You can use it in cBot

        [Parameter(DefaultValue = 3.0, MinValue = 1, MaxValue = 4)]
        public int degree { get; set; }
 
        [Parameter(DefaultValue = 2000)]
        public int period { get; set; }
 
        [Parameter(DefaultValue = 1.7)]
        public double strdDev { get; set; }
 
        [Output("PRC", Color = Colors.Gray, LineStyle = LineStyle.Lines)]
        public IndicatorDataSeries prc { get; set; }
 
        [Output("SQH", Color = Colors.Red, LineStyle = LineStyle.Lines)]
        public IndicatorDataSeries sqh { get; set; }
 
        [Output("SQL", Color = Colors.DodgerBlue, LineStyle = LineStyle.Lines)]
        public IndicatorDataSeries sql { get; set; }

 


@mindbreaker

mindbreaker
27 May 2015, 15:30

RE:

davidp13 said:

Anyone to help me pls?

Hi, look at this how use custom indicator and get his values :

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


@mindbreaker

mindbreaker
27 May 2015, 15:27

RE: RE:

btw. They are inclined to take people on money rather than helping.

In what world you ... live.


@mindbreaker

mindbreaker
27 May 2015, 15:24

RE:

fxMinnow said:

Since Website down last,

They don`t reply.(or don`t work??)

What in the world happened?


 

Maybe hackers rules :D:D:D:D:D


@mindbreaker

mindbreaker
24 May 2015, 13:14

RE:

3052551 said:

Hi guys,

I am working on a strategy where close position happens after X bars.

in my OnBar() i obtain the current bar index: int index = MarketSeries.Close.Count - 1;

My question is: how I can obtain the bar index of a currently open position (I am using positions.find function) ?

 

int CountBars = 0;

// close after

int CloseAfter = 10;

OnBar(){

CountBars++;

if(CountBars > CloseAfter)
 {

 CountBars = 0;

 // close here

 Close(position);

 }

}

This simple example.

 


@mindbreaker

mindbreaker
14 May 2015, 16:54

RE:

Treaz van der Momom said:

HELLO I WANT TO MAKE CBOT HIGH FREKUENSI TRADING .,.,  WHO IS WANT TO HELP ME.,.,!!!!1
 

It does not work on cAlgo. It impossible. Dont waste Your time.


@mindbreaker

mindbreaker
07 May 2015, 20:55

RE:

tradermatrix said:

"Use < insert code>  button when You add cBot code:"

ok leader...

My code works but:

optimizer with my code is impossible....!!

 

It looks nicer :D:D:D

I dont know, maybe support know it?

 


@mindbreaker

mindbreaker
07 May 2015, 19:33

RE: RE:

Use < insert code>  button when You add cBot code:

// -------------------------------------------------------------------------------------------------
//
//    This code is a cAlgo API sample.
//
//    This cBot is intended to be used as a sample and does not guarantee any particular outcome or
//    profit of any kind. Use it at your own risk
//
//    The "Sample Martingale cBot" creates a random Sell or Buy order. If the Stop loss is hit, a new 
//    order of the same type (Buy / Sell) is created with double the Initial Volume amount. The cBot will 
//    continue to double the volume amount for  all orders created until one of them hits the take Profit. 
//    After a Take Profit is hit, a new random Buy or Sell order is created with the Initial Volume amount.
//
// -------------------------------------------------------------------------------------------------

using System;
using System.Linq;
using cAlgo.API;
using cAlgo.API.Indicators;
using cAlgo.API.Internals;
using cAlgo.Indicators;
using System.Diagnostics;
using System.Threading;


namespace cAlgo
{
    [Robot(TimeZone = TimeZones.UTC, AccessRights = AccessRights.None)]
    public class SampleMartingalecBot : Robot
    {
        [Parameter("Initial Volume", DefaultValue = 10000, MinValue = 0)]
        public int InitialVolume { get; set; }

        [Parameter("Stop Loss", DefaultValue = 10)]
        public int StopLoss { get; set; }

        [Parameter("Take Profit", DefaultValue = 10)]
        public int TakeProfit { get; set; }

        [Parameter("delay minute", DefaultValue = 1)]
        public int Minute { get; set; }

        private Random random = new Random();

        protected override void OnStart()
        {
            Positions.Closed += OnPositionsClosed;

            Order1();
        }
        private void Order1()
        {
            var stopwatch = Stopwatch.StartNew();
            System.Threading.Thread.Sleep(Minute * 60000);
            Console.WriteLine(stopwatch.ElapsedMilliseconds);


            ExecuteOrder(InitialVolume, GetRandomTradeType());

        }

        private void ExecuteOrder(long volume, TradeType tradeType)
        {



            var result = ExecuteMarketOrder(tradeType, Symbol, volume, "Martingale", StopLoss, TakeProfit);

            if (result.Error == ErrorCode.NoMoney)
                Stop();

        }

        private void OnPositionsClosed(PositionClosedEventArgs args)
        {

            Print("Closed");
            var position = args.Position;


            {


                if (position.Label != "Martingale" || position.SymbolCode != Symbol.Code)
                    return;
                if (position.Pips > 0)
                    Order1();

                if (position.GrossProfit > 0)
                {
                    ExecuteOrder(InitialVolume, GetRandomTradeType());
                }
                else
                {


                    ExecuteOrder((int)position.Volume * 2, position.TradeType);
                }
            }
        }


        private TradeType GetRandomTradeType()
        {
            return random.Next(2) == 0 ? TradeType.Buy : TradeType.Sell;
        }
    }
}

 

 

 


@mindbreaker

mindbreaker
07 May 2015, 19:29

RE:

Maybe change thread to:

 

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading;

namespace TimeStamp
{
    class Program
    {

        public static Int32 time = 0;

        static void Main(string[] args)
        {

                // Timestamp now unix format seconds
                time = (Int32)(DateTime.UtcNow.Subtract(new DateTime(1970, 1, 1))).TotalSeconds;

                // timestamp + 20 seconds start after 20 sec
                int timeStart = time + 20;
            
            while (true) {
                // Timestamp now unix format seconds
                Int32 timenow = (Int32)(DateTime.UtcNow.Subtract(new DateTime(1970, 1, 1))).TotalSeconds;

                if (timenow > timeStart) { Console.WriteLine(time); }

            }
        }
    }
}

 


@mindbreaker

mindbreaker
07 May 2015, 08:43

RE: RE:
while(timenow < timetostart){

print("waiting for triger");

}

 


@mindbreaker

mindbreaker
07 May 2015, 08:39

RE:

tradermatrix said:

hello
 I want to delay the cycle of my robot after each profit or loss

for that,I am looking for a formula that my robot starts one minute after it is turned on.

exemple:

   protected override void OnStart()
         {
  var sellOrderTargetPrice = Symbol.Bid - PipsAway * Symbol.PipSize; PlaceStopOrder(TradeType.Sell, Symbol, InitialVolume, sellOrderTargetPrice, Label, StopLoss, TakeProfit);

   var buyOrderTargetPrice = Symbol.Ask + PipsAway * Symbol.PipSize;PlaceStopOrder(TradeType.Buy, Symbol, InitialVolume, buyOrderTargetPrice, Label, StopLoss, TakeProfit);
}

with this example StopOrders are instant to start the robot.
I would like if possible delay of one minute after startup.
cordially.

 

http://www.dotnetperls.com/sleep

Thread.Sleep(60000);

https://msdn.microsoft.com/en-us/library/system.datetime.now%28v=vs.110%29.aspx

or use datatime.

if (timenow < timetostart){

print("waiting for triger");

}


@mindbreaker

mindbreaker
06 May 2015, 12:16

RE:

GS66 said:

Hi,

I have already reinstalled it and tested with another broker, but this two bots still don't work. I suppose the code has something obsolete.

/algos/cbots/show/257

/algos/cbots/show/199

 

 

 

dont downlad cbot - create new cbot  copy code and past and build in calgo


@mindbreaker

mindbreaker
06 May 2015, 11:22

RE: RE:

This post was removed by moderator.


@mindbreaker

mindbreaker
06 May 2015, 11:07

RE:

GS66 said:

Hi,

I tried tested two bots on ctdn, the news bots, and no one is even able to trigger a trade.

Backtesting do not works

Demo account do not works.

Can anyone please explain why and how to solve it

 

Reinstall cAlgo or change broker, or reinstal windows and intall again.

It is normal on cAlgo its dump but possible.


@mindbreaker