is this right?

Created at 01 Nov 2018, 15:55
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

jelle2500

Joined 25.11.2017

is this right?
01 Nov 2018, 15:55


MarketSeries.Low.Last(1) is the previous low

MarketSeries.Low.Last(2) is the low before that ?

MarketSeries.Low.Last (3) is the low before Last(2) ??


@jelle2500
Replies

PanagiotisCharalampous
01 Nov 2018, 15:58

Hi jelle2500,

Yes this is right.

Best Regards,

Panagiotis


@PanagiotisCharalampous

jelle2500
01 Nov 2018, 16:01

RE:

Panagiotis Charalampous said:

Hi jelle2500,

Yes this is right.

Best Regards,

Panagiotis

thanks Panagiotis! for the last part of my bot i'm tryping to make a take profit on last(3)

so when a buy trade is open take profit should be on MarketSeries.Low.Last(3)

and when a sell trade is open take profit should be on MarketSeries.High.Last(3)

 

can you help me with this?


@jelle2500

PanagiotisCharalampous
01 Nov 2018, 16:13

Hi jelle2500,

Here you are

            var tpBuy = Math.Round((MarketSeries.Low.Last(3) - Symbol.Ask) / Symbol.PipSize, Symbol.Digits);

            var tpSell = Math.Round((Symbol.Bid - MarketSeries.High.Last(3)) / Symbol.PipSize, Symbol.Digits);

Best Regards,

Panagiotis


@PanagiotisCharalampous

jelle2500
01 Nov 2018, 16:14

RE:

Panagiotis Charalampous said:

Hi jelle2500,

Here you are

            var tpBuy = Math.Round((MarketSeries.Low.Last(3) - Symbol.Ask) / Symbol.PipSize, Symbol.Digits);

            var tpSell = Math.Round((Symbol.Bid - MarketSeries.High.Last(3)) / Symbol.PipSize, Symbol.Digits);

Best Regards,

Panagiotis

you are the best! thanks Panagiotis!


@jelle2500