How to trigger Reverse Position based on Negative Pips

Created at 01 Jun 2020, 23:33
IN

indrakh

Joined 25.05.2020

How to trigger Reverse Position based on Negative Pips
01 Jun 2020, 23:33


Hi,

I'm kinda new in cBot programming and using cTrader Desktop 3.7 Release.
I'm very sorry if this asked before.

My question is:
How to trigger Reverse Position based on Negative Pips?.

eg:

When Buy (or Sell)  Pips counted as -50 then Reverse Position.
Any examples?.

Many thanks in advance.

 

 


@indrakh
Replies

PanagiotisCharalampous
02 Jun 2020, 08:20

Hi indrakh,

Here is a starting point

            if (Positions[0].Pips < -50)
            {
                Positions[0].Reverse();
            }

Best Regards,

Panagiotis 

Join us on Telegram

 


@PanagiotisCharalampous

indrakh
02 Jun 2020, 13:03

RE:

PanagiotisCharalampous said:

Hi indrakh,

Here is a starting point

            if (Positions[0].Pips < -50)
            {
                Positions[0].Reverse();
            }

Best Regards,

Panagiotis 

Join us on Telegram

Hi Panagiotis,

Many thanks for your quick response.
Could you be more specific on how to implement it?.
I tried to add in my testing cbot, but it doesnt work.


B. Rgds,
-ikh

 


@indrakh