Get all Open Positions
Get all Open Positions
25 Sep 2022, 10:43
Hi
Reading through the API Reference, the Positions.FindAll() method requires a label to search for.
The bot that I'm making executes orders with the label determined by the candlestick pattern. So if the order is executed because it's a shooting star, the label will be "Shooting Star". I'm doing this to do analysis on each position type in Pandas. This obviously means, I don't know what label to look for as I need to know what labels my orders have. So is there a way I can simply list all open positions, store those in a variable and loop over them to check for the condition I want to perform?
I essentially want to move my SL to 1pip in profit once price has moved 75% to my TP in roughly the same way you can do in cTrader itself by protecting the position.
Replies
ctid3999979
26 Sep 2022, 11:55
RE:
PanagiotisCharalampous said:
Hi there,
Just use Positions :) It's a collection.
Best Regards,
Panagiotis
Damn it. Hahaha
Cheers :)
@ctid3999979
PanagiotisCharalampous
26 Sep 2022, 10:52
Hi there,
Just use Positions :) It's a collection.
Best Regards,
Panagiotis
Join us on Telegram and Facebook
@PanagiotisCharalampous