READ-ONLY

The forum is now a read-only archive.

For bug reports & platform questions → [email protected]

Our community lives on Discord and YouTube — come join us!

In custom indicator, Can’t access order info in Strategy.Trader

1 replies

telemanius

Subscriber, bbp_participant, 9 replies.

Visit profile

1 year ago #290344

I created a custom indicator snippet and tried to retrieve orders information. The compilation is successful but when I tested it in algowizard a tradingException is shown.
The only thing I modified for this custom indicator is the OnBarUpdate method, which looks like below
   @Override
    protected void OnBarUpdate() throws TradingException {
        double result = 0;
        int opencount = Strategy.Trader.getOpenOrdersCount()
        Main.set(0, result);
    }
Is it not possible to access strategy orders in custom indicators? is there any way to do it? I want to create exits similar to ExitAfterBars that uses BarsSinceOrderOpen, which uses the open order information.

0

telemanius

Subscriber, bbp_participant, 9 replies.

Visit profile

1 year ago #290345

Maybe it is possible to implement in strategy control?
Can I retrieve both market data and open/historical order information in strategy control?

0

Viewing 1 replies (of 1 total)