PanagiotisCharalampous's avatar
PanagiotisCharalampous
26 follower(s) 0 following 1006 subscription(s)
Replies

PanagiotisCharalampous
30 Oct 2018, 09:43

Hi Jan,

Thank you for contacting Spotware. If you share with us the cBot code and steps to reproduce, we might be able to advise you what the problem is.

Best Regards,

Panagiotis


@PanagiotisCharalampous

PanagiotisCharalampous
29 Oct 2018, 17:50

Hi Sasha,

See below

            foreach (var obj in Chart.Objects)
            {
                if (obj is ChartHorizontalLine)
                {
                    var line = (ChartHorizontalLine)obj;
                    Print(line.Y);
                }
            }

Best Regards,

Panagiotis


@PanagiotisCharalampous

PanagiotisCharalampous
29 Oct 2018, 14:15

Hi pgplanas@hotmail.com,

Thank you for posting in our forum. If your broker has upgraded to cTrader 3.3 then it is not possilbe to login with your trading account credentials anymore. You will need to contact your broker to link the accounts with your cTID.

Best Regards,

Panagiotis 


@PanagiotisCharalampous

PanagiotisCharalampous
29 Oct 2018, 14:07

Hi lec0456,

Note that I am referring to replacing the Print function and writing to a text file instead. See below an example

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

namespace cAlgo.Robots
{
    [Robot(TimeZone = TimeZones.UTC, AccessRights = AccessRights.FileSystem)]
    public class NewcBot : Robot
    {
        private string fiName;
        private StreamWriter _fileWriter;
        protected override void OnStart()
        {
            _fileWriter = new StreamWriter("c:\\Users\\pcharalampous.CTRADER\\Documents\\log.txt");
            // Put your initialization logic here
        }

        protected override void OnTick()
        {
            _fileWriter.WriteLine(Symbol.Bid);
        }

        protected override void OnStop()
        {
            _fileWriter.Close();
        }
    }
}

 

Best Regards,

Panagiotis


@PanagiotisCharalampous

PanagiotisCharalampous
29 Oct 2018, 11:47

Hi Sasha,

  1. You can use out keyword
  2. A cBot cannot stop other cBots, at least in a direct way. If you could explain what you are trying to do, I could suggest something.

Best Regards,

Panagiotis

 


@PanagiotisCharalampous

PanagiotisCharalampous
29 Oct 2018, 11:42

Hi sancra01,

Spotware Connect API is fully operational and fully supported. Let me know if you need any further assistance.

Best Regards,

Panagiotis


@PanagiotisCharalampous

PanagiotisCharalampous
29 Oct 2018, 11:37

Hi netread2004,

Can you share the cBot code so that we can reproduce the issue?

Best Regards,

Panagiotis


@PanagiotisCharalampous

PanagiotisCharalampous
29 Oct 2018, 11:34

Hi lec0456,

The limit is ten thousand rows. If you need more, you can consider using a custom file and log your information there.

Best Regards,

Panagiotis


@PanagiotisCharalampous

PanagiotisCharalampous
29 Oct 2018, 11:27

Hi nguyendan81985,

Could you please let us know the symbol as well so that I can reproduce this behavior in backtesting?

Best Regards,

Panagiotis


@PanagiotisCharalampous

PanagiotisCharalampous
29 Oct 2018, 11:18

Hi Sasha,

This is not a bug. As the message says this function is not supported in backtesting.

Best Regards,

Panagiotis


@PanagiotisCharalampous

PanagiotisCharalampous
29 Oct 2018, 11:12

Hi nguyendan81985,

You can check Visual Backtesting which included in Spotware Beta.

Best Regards,

Panagiotis


@PanagiotisCharalampous

PanagiotisCharalampous
29 Oct 2018, 11:03

Hi Shawn,

I have forwarded your suggestions to the product team for consideration. I would also suggest that you post them in vote.spotware.com so that other traders can vote them as well. Popular suggestions have more chances to get implemented.

Best Regards,

Panagiotis


@PanagiotisCharalampous

PanagiotisCharalampous
26 Oct 2018, 11:28

Hi Sasha, 

You can just check this condition before executing an order.

Best Regards,

Panagiotis


@PanagiotisCharalampous

PanagiotisCharalampous
26 Oct 2018, 10:14

Hi Sonar Trades,

Symbol.Ask - Symbol.Bid should give you the spread. Let me know if this is what you were looking for.

Best Regards,

Panagiotis


@PanagiotisCharalampous

PanagiotisCharalampous
26 Oct 2018, 09:43

Use Spotware Beta


@PanagiotisCharalampous

PanagiotisCharalampous
26 Oct 2018, 09:43 ( Updated at: 21 Dec 2023, 09:20 )

Here it is


@PanagiotisCharalampous

PanagiotisCharalampous
26 Oct 2018, 09:39

Hi tradingu,

Yes you can. We already started rolling out 3.3 to some brokers.

Best Regards,

Panagiotis


@PanagiotisCharalampous

PanagiotisCharalampous
26 Oct 2018, 09:29

Hi nguyendan81985,

See below

using System;
using System.Collections.Generic;
using System.Linq;
using cAlgo.API;
using cAlgo.API.Indicators;
using cAlgo.API.Internals;
using cAlgo.Indicators;

namespace cAlgo.Robots
{
    [Robot(TimeZone = TimeZones.UTC, AccessRights = AccessRights.None)]
    public class NewcBot : Robot
    {
        [Parameter(DefaultValue = 0.0)]
        public double Parameter { get; set; }

        ExponentialMovingAverage _ema;
        protected override void OnStart()
        {
            _ema = Indicators.ExponentialMovingAverage(MarketSeries.Close, 34);
        }

        protected override void OnTick()
        {
            if (MarketSeries.Close.HasCrossedAbove(_ema.Result, 1))
                ExecuteMarketOrder(TradeType.Buy, Symbol, 1000);
            if (MarketSeries.Close.HasCrossedBelow(_ema.Result, 1))
                ExecuteMarketOrder(TradeType.Sell, Symbol, 1000);
        }

        protected override void OnStop()
        {
            // Put your deinitialization logic here
        }
    }
}

Best Regards,

Panagiotis


@PanagiotisCharalampous

PanagiotisCharalampous
26 Oct 2018, 09:25

Hi Tansen,

There is no easy way to do this. You will need to write your data in a file or database and then read it from there.

Best Regards,

Panagiotis


@PanagiotisCharalampous

PanagiotisCharalampous
26 Oct 2018, 09:22 ( Updated at: 21 Dec 2023, 09:20 )

Hi lec0456,

Here is an example

using System;
using System.Collections.Generic;
using System.Linq;
using cAlgo.API;
using cAlgo.API.Indicators;
using cAlgo.API.Internals;
using cAlgo.Indicators;

namespace cAlgo.Robots
{
    [Robot(TimeZone = TimeZones.UTC, AccessRights = AccessRights.None)]
    public class NewcBot : Robot
    {
        [Parameter(DefaultValue = 0.0)]
        public double Parameter { get; set; }

        protected override void OnStart()
        {
            ChartObjects.DrawHorizontalLine("Test", Symbol.Bid, Colors.Red);
        }

        protected override void OnTick()
        {
        }

        protected override void OnStop()
        {
            // Put your deinitialization logic here
        }
    }
}

and here is what you should see on the chart

Make sure you are using Visual Mode.

Best Regards,

Panagiotis


@PanagiotisCharalampous