How can I create order in an indicator?

Created at 18 Jan 2021, 16:09
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!
WI

winsonet

Joined 03.01.2021

How can I create order in an indicator?
18 Jan 2021, 16:09


I want to call the PlaceStopOrder and ExecuteMarketOrder in an indicator, can I do that?

I know I should use these in a cBot, but my indicator just like a tool to setup the risk/reward and find the stop loss and take profit value, so I want to create the order within the indicator, I also try to do these with a cBot and it works fine, but I just find that can't sync the symbols in different windows when I was using the cBot:

that's why I want to use an indicator, any ideas?

 

thanks!


@winsonet
Replies

JerryTrader
05 Feb 2021, 20:16

You can't.

Indicators are just made to draw things on charts, but don't have any access to your account, nor orders, positions, etc...

Your indicator could write its calculated stop loss / take profit to a file or in registry.
Then you create a cBot that listens to this file or registry change, reads the values, and create orders accordingly.


@JerryTrader

Jobauma
06 May 2022, 13:09

Hi. :)

How to write from registry?

Thanks.

Best regards,

Johannes Hillestad Baumann


@Jobauma

amusleh
06 May 2022, 13:28

RE:

Jobauma said:

Hi. :)

How to write from registry?

Thanks.

Best regards,

Johannes Hillestad Baumann

Hi,

Please create a new thread for your question.


@amusleh

mraimbot
26 Jun 2024, 11:31 ( Updated at: 26 Jun 2024, 11:44 )

  • Since recently it is possible to place orders with indicators.
  • To update your old indicators you have to change the cTrader.Automate-Version of the project file (from "1.*") to “*”.

@mraimbot