HELP for a repeated action.

Created at 15 May 2023, 10:05
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!
GO

Goulk

Joined 17.11.2022

HELP for a repeated action.
15 May 2023, 10:05


Hello to all,
I have a question for you, can you create an action that repeats every (X PIP) away ?

Example:

On EURUSD
Every 10 PIPS away from PRICE X, OPEN ONE POSITION.

If possible, I need an example because I am not very practical. 

Thank you for your time
 :D


@Goulk
Replies

firemyst
15 May 2023, 11:50

RE:

Goulk said:

Hello to all,
I have a question for you, can you create an action that repeats every (X PIP) away ?

Example:

On EURUSD
Every 10 PIPS away from PRICE X, OPEN ONE POSITION.

If possible, I need an example because I am not very practical. 

Thank you for your time
 :D

 

Some sample code to do something every x pips going long:


if (currentPrice >= priceX + (Symbol.PipSize * 10))
{
     //do what you want when you want to be at least 
     //10 pips higher than the last time you entered
}

 


@firemyst

Goulk
15 May 2023, 12:03

RE: RE:

firemyst said:

Goulk said:

Hello to all,
I have a question for you, can you create an action that repeats every (X PIP) away ?

Example:

On EURUSD
Every 10 PIPS away from PRICE X, OPEN ONE POSITION.

If possible, I need an example because I am not very practical. 

Thank you for your time
 :D

 

Some sample code to do something every x pips going long:


if (currentPrice >= priceX + (Symbol.PipSize * 10))
{
     //do what you want when you want to be at least 
     //10 pips higher than the last time you entered
}

 

Thanks a lot, I'll try now. :)

@Goulk