Opened Orders multiple Email / SMS send

08 Jan 2017, 18:18Opened Orders multiple Email / SMS send#1
Luckyman86posts: 2since: 03 Dec 2014

Hello all.

I was enquiring if there way to send opened trade information to multiple email addresses or SMS via the cAGLO platorm?

Alternatively if this is not feasible - opened trade information to an Excel file?

Many thanks

 

 

08 Jan 2017, 19:19#2
lucianposts: 203since: 26 Dec 2015

You can try something like this:

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

namespace cAlgo
{
    [Robot(TimeZone = TimeZones.UTC, AccessRights = AccessRights.None)]
    public class Email : Robot
    {

        [Parameter("Send Email Name", DefaultValue = "send@email.com")]
        public string send { get; set; }
        [Parameter("Receive Email Name1", DefaultValue = "receive1@email.com")]
        public string receive1 { get; set; }
        [Parameter("Receive Email Name2", DefaultValue = "receive2@email.com")]
        public string receive2 { get; set; }

        protected override void OnStart()
        {
            Positions.Opened += openedposition;
        }
        public void openedposition(PositionOpenedEventArgs arg)
        {
            var pos = arg.Position;
            string mesaj = "UTC: " + Server.Time + "  Position Symbol " + pos.SymbolCode + "  Position Entry Price = " + pos.EntryPrice + ",   Position Volume =  " + pos.Volume;
            Notifications.SendEmail(send, receive1, "new poasition open", mesaj);
            Notifications.SendEmail(send, receive2, "new position open", mesaj);

        }
    }
}

and proper settings to cAlgo / Preferences / Email Settings


www.calgocbots.com