Entry from the screen

Created at 04 Nov 2018, 11:19
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!
alexander.n.fedorov's avatar

alexander.n.fedorov

Joined 02.01.2018

Entry from the screen
04 Nov 2018, 11:19


Dear Panagiotis, hi!

Suppose, in cBot there is a public field to enter a buy on limit order price.

And suppose, instead of typing the price into the parameters, I would like to point at the screen?

Is it possible?

If not now, is possible to inclue into on of the next versions?

(you know, like they do it in Autocad?)

Regards, 

Alexander

 

 


@alexander.n.fedorov
Replies

PanagiotisCharalampous
05 Nov 2018, 10:32

Hi Sasha,

We do not have plans to develop this. You can develop it yourself by using the Chart.MouseDown event to read the price level when the mouse is clicked. See below an example.

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

namespace cAlgo.Robots
{
    [Robot(TimeZone = TimeZones.RussianStandardTime, AccessRights = AccessRights.FullAccess)]
    public class newcBot : Robot
    {

        protected override void OnStart()
        {          
            Chart.MouseDown += Chart_MouseDown;          
        }

        private void Chart_MouseDown(ChartMouseEventArgs obj)
        {
            Print("Price: " + obj.YValue);
        }
    }
}

Best Regards,

Panagiotis


@PanagiotisCharalampous

alexander.n.fedorov
05 Nov 2018, 10:44

Hi, Panagiotis

I think it is a very helpfull event. I will have to try

Regards,

 

Sasha


@alexander.n.fedorov

alexander.n.fedorov
10 Nov 2018, 17:47

Dear Panagiotis, hi!

How can I alter the above event, for example with a use of {AltKey}?

 

Regards,

 

Sasha


@alexander.n.fedorov

PanagiotisCharalampous
12 Nov 2018, 12:36

Hi Sasha,

There is no event for KeyPress at the moment. You can find the available events here.

Best Regards,

Panagiotis


@PanagiotisCharalampous