broker position info  [SOLVED]

Questions about MultiCharts .NET and user contributed studies.
RobBoss

broker position info

Postby RobBoss » 08 Nov 2016

Hello All,

Quick question about finding broker position info.

I have been using this:

Code: Select all

private double LastEntryPrice()
{
if (StrategyInfo.MarketPosition == 0)
return 0;

int lastTradeIndex = Positions[0].OpenTrades.Count - 1;

return Positions[0].OpenTrades[lastTradeIndex].EntryOrder.Price;
}
//credit to JoshM

to track strategy position price.

I want my signal to react to broker position in the slim chance that I open a manual trade. Currently, if I am flat with the strategy and open a position manually, the Positions[0] can not return the appropriate info, because it does not recognize the manual trades.

I was wondering if there was a way to grab information specifically from the broker position, compared to the strategy position.

Thanks

darob
Posts: 207
Joined: 20 Nov 2014
Has thanked: 57 times
Been thanked: 32 times

Re: broker position info

Postby darob » 09 Nov 2016

Hi RobBoss, I had a similar situation that was resolved by using StrategyInfo.MarketPositionAtBroker.

Best regards

RobBoss

Re: broker position info

Postby RobBoss » 09 Nov 2016

Hey darob,

I am using MarketPositionAtBroker in the most important part of my code. What I am looking for would be more along the lines of:

return PositionsATBROKER[0].OpenTrades[lastTradeIndex].EntryOrder.Price;

I would like to be able to grab specific info from a trade that was done manually, and have the signal react accordingly. Right now I can only find info about trades submitted by the strategy.

Thanks,

darob
Posts: 207
Joined: 20 Nov 2014
Has thanked: 57 times
Been thanked: 32 times

Re: broker position info  [SOLVED]

Postby darob » 09 Nov 2016

Hi RobBoss

You can inform your strategy of manual trades with the broker to strategy synchronizer:

https://www.multicharts.com/trading-sof ... _at_a_Time

Then how your signal reacts to it is up to you and your code. Maybe that's the bit you're asking about. Someone else may need to chime in here.

Good luck.

RobBoss

Re: broker position info

Postby RobBoss » 09 Nov 2016

Thank you darob,

I completely forgot about the prebuilt strategies in MC.

Now here's hoping I can implement it.

Thanks


Return to “MultiCharts .NET”