Topics
21 Jul 2019, 00:25
 1129
 2
Replies

bitmext
13 Jun 2019, 07:32

RE:

Panagiotis Charalampous said:

Hi bitmext,

Thanks for posting in our forum and for your nice feedback about the platform. There is no feature in the interface that would allow you to do so but you can achieve this by running a simple cBot. See the source code below

using System;
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 ReversePositions : Robot
    {

        protected override void OnStart()
        {
            foreach (var position in Positions)
                position.Reverse();
            Stop();
        }

        protected override void OnTick()
        {
            // Put your core logic here
        }

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

Best Regards,

Panagiotis

I have just tested this on my Demo Account and it works perfectly !

Exactly what I needed, Thank you very much.


@bitmext