Email Notification on any position opened including manual trades

Created at 24 Mar 2013, 16:30
How’s your experience with the cTrader Platform?
Your feedback is crucial to cTrader's development. Please take a few seconds to share your opinion and help us improve your trading experience. Thanks!
JR

JRWEnigmaPips

Joined 24.03.2013

Email Notification on any position opened including manual trades
24 Mar 2013, 16:30


Hello,

 

I have been trading for 5 years, however only recently tried programming, I am trying to build an robot or indicator that does the following:

If I have manually set a pending order, and it is then opened, I would receive an email, stating that the position has been opened.

It's a simple concept but I can't get my head around doing it, I've attempted to produce this with the following: 

using System;
using cAlgo.API;
using cAlgo.API.Indicators;
using cAlgo.API.Requests;
using cAlgo.Indicators;

namespace cAlgo.Robots
{
    [Robot]
    public class emailer : Robot
    {
    	private Position position;
        
        protected override void OnPositionOpened(Position openedPosition)
        {
       		Notifications.SendEmail("email@gmail.com","email@gmail.com","Position Opened","The position has been opened");
            position = openedPosition;
        }

    }
}

 

I believe it may work better as an indicator, I just want to have this robot or indicator running so it sends a notification when a position has been opened.

 

I really appreciate the help in advance, and look forward to a response.

 

Thanks


@JRWEnigmaPips
Replies

cAlgo_Fanatic
26 Mar 2013, 10:53 ( Updated at: 23 Jan 2024, 13:11 )

Please refer to [/forum/indicator-support/623]


@cAlgo_Fanatic