how to get distance i pips price-limit order to Cbot pleease?

Created at 13 Jun 2017, 14:12
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!
RE

Renda

Joined 13.03.2016

how to get distance i pips price-limit order to Cbot pleease?
13 Jun 2017, 14:12


Hello all,

can someone please help me how to get the distance from current price to limit order? position.Entryprice is i think for filled positions and somethink like order.Entryprice is possible?

 

I want to be alerted when price is near about 3pips from my limit order and already made a reaction for example 10 pips. It is simple to use build in alerts, but i want to be alerted only when price made a reaction without filling me, so i can remove the limit order and not to take second test of my level. I am trying to program this a long time, but it is not working good, i need to know the distance price---limit.order.

 

Thank you very much for any info.

 

Rene 


@Renda
Replies

Renda
16 Jun 2017, 10:45

Do not tell me that noone ever needed such a information in his Cbot. I just need to know how far from my limit orders is the price right now. Is there any way???? pleeese, right now i am trying to read entry prices of my limit orders from excel file and compre them with bid/ask price, but it is not what i need.


@Renda

Jiri
16 Jun 2017, 11:13

Difference between current price and target price of pending order, divided by pip size gives you number of pips away from your order.

/api/reference/pendingorder/targetprice


@Jiri

Renda
18 Jun 2017, 02:13

RE:

tmc. said:

Difference between current price and target price of pending order, divided by pip size gives you number of pips away from your order.

/api/reference/pendingorder/targetprice

Thank you very much,

 

but can you tell me please how to read the "targetprice" when i have alredy some pending orders set. Maybe some example please.


@Renda

Jiri
18 Jun 2017, 11:34

private void PrintDistanceForEachPendingOrder()
{
    var pendingOrders = PendingOrders;

    foreach (var pendingOrder in pendingOrders)
    {
        var distancePips = Math.Round(Math.Abs(pendingOrder.TargetPrice - (pendingOrder.TradeType == TradeType.Buy ? Symbol.Ask : Symbol.Bid)) / Symbol.PipSize, 1);
        Print(distancePips);
    }
}

 


@Jiri

Renda
18 Jun 2017, 20:05

RE:

tmc. said:

private void PrintDistanceForEachPendingOrder()
{
    var pendingOrders = PendingOrders;

    foreach (var pendingOrder in pendingOrders)
    {
        var distancePips = Math.Round(Math.Abs(pendingOrder.TargetPrice - (pendingOrder.TradeType == TradeType.Buy ? Symbol.Ask : Symbol.Bid)) / Symbol.PipSize, 1);
        Print(distancePips);
    }
}

You are the best!!!!

 

Thank you very much, i will try it as soon as the market is active. Again thanks a lot, you save me a bunch of time!

 

Rene

 

 


@Renda

Renda
19 Jun 2017, 09:34

RE: RE:

Renda said:

tmc. said:

private void PrintDistanceForEachPendingOrder()
{
    var pendingOrders = PendingOrders;

    foreach (var pendingOrder in pendingOrders)
    {
        var distancePips = Math.Round(Math.Abs(pendingOrder.TargetPrice - (pendingOrder.TradeType == TradeType.Buy ? Symbol.Ask : Symbol.Bid)) / Symbol.PipSize, 1);
        Print(distancePips);
    }
}

You are the best!!!!

 

Thank you very much, i will try it as soon as the market is active. Again thanks a lot, you save me a bunch of time!

 

Rene

It is working, again thanks man! And thanks to this forum!

Rene

 

 


@Renda

Jiri
19 Jun 2017, 10:55

You're welcome!


@Jiri