How to "store" Position.EntryPrice

Created at 06 Jun 2016, 10:53
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!
JE

jeremy.vostik

Joined 13.05.2016

How to "store" Position.EntryPrice
06 Jun 2016, 10:53


Is there a way to get the vertical value (y, price) from a opened Position stored somehow, so I can enter a new Position at the same Price automatically when my criteria are met again?

I tried LastValue.Position.EntryPrice, but that does nothing. And as Long as that code is there no positions get opened any longer.


@jeremy.vostik
Replies

belonohy
06 Jun 2016, 11:01

RE:

Open price on "Position" object is not enough? 

You can check it anytime...


@belonohy

jeremy.vostik
06 Jun 2016, 11:47

How exactly do I check it?

The Problem is, that I Need to store that number for later use somehow. Just like index -1; index -2 for example.

I Need the (first) Position entry Price. saved. so that when i open other positions I can still Access that pricelevel.

Wouldn't opening new positions override that number?

 

Maybe I can do something like

ExecuteMarketOrder(.....yadayada)

double firstEntryPrice = Position.OpenPrice

 

and for every new Position I create a new double.

Problem there is, what if I have an already manuall opened Position and I run the cBot after that? How do I "call" that open positions OpenPrice?

I would Need to find that open Position first and than extract that Price to a double.

 

Correct me if I am wrong or if I overcomplicate things :D

 


@jeremy.vostik

Spotware
07 Jun 2016, 15:05

Dear Trader,

Please have a look at the Positions.FindAll Method.

We hope, it will help you with your query.


@Spotware

... Deleted by UFO ...