Indicator Knowing What Strategy Is Doing?

Questions about MultiCharts and user contributed studies.
User avatar
furytrader
Posts: 353
Joined: 30 Jul 2010
Location: Chicago, IL
Has thanked: 154 times
Been thanked: 215 times

Indicator Knowing What Strategy Is Doing?

Postby furytrader » 30 Sep 2010

I've done some research already online about this question and I can't seem to find an answer other than "No" so I thought I'd throw it here on the forum.

Is there an easy way for an indicator placed on a chart to know what a strategy placed on that same chart is doing? In other words, is it long or short?

User avatar
Anastassia
Posts: 179
Joined: 18 Jan 2010
Been thanked: 4 times

Re: Indicator Knowing What Strategy Is Doing?

Postby Anastassia » 30 Sep 2010

Hi FuryTrader,

It is possible to do so. Use i_marketposition keyword.

~~~~~
i_MarketPosition

Returns a numerical value, indicating the type of the specified position.
A value of 1 indicates the current bar has a long position, -1 indicates the current bar has a short position, and 0 is returned only if the current bar has a flat position.

Usage
i_MarketPosition

Notes
This function can only be used in studies.

Example
i_MarketPosition will return a value of 0 if the position on the current bar is flat

i_MarketPosition will return a value of 1 if the position on the current bar is long

i_MarketPosition will return a value of -1 if the position on the current bar is short

Thank you

User avatar
furytrader
Posts: 353
Joined: 30 Jul 2010
Location: Chicago, IL
Has thanked: 154 times
Been thanked: 215 times

Re: Indicator Knowing What Strategy Is Doing?

Postby furytrader » 30 Sep 2010

Perfect - thanks!!!

User avatar
Anastassia
Posts: 179
Joined: 18 Jan 2010
Been thanked: 4 times

Re: Indicator Knowing What Strategy Is Doing?

Postby Anastassia » 30 Sep 2010

You are welcome!

Spaceant
Posts: 252
Joined: 30 May 2009
Has thanked: 1 time
Been thanked: 3 times

Re: Indicator Knowing What Strategy Is Doing?

Postby Spaceant » 01 Oct 2010

Anastassia wrote:Hi FuryTrader,

It is possible to do so. Use i_marketposition keyword.

~~~~~
i_MarketPosition

Returns a numerical value, indicating the type of the specified position.
A value of 1 indicates the current bar has a long position, -1 indicates the current bar has a short position, and 0 is returned only if the current bar has a flat position.

Usage
i_MarketPosition

Notes
This function can only be used in studies.

Example
i_MarketPosition will return a value of 0 if the position on the current bar is flat

i_MarketPosition will return a value of 1 if the position on the current bar is long

i_MarketPosition will return a value of -1 if the position on the current bar is short

Thank you


Is this returning the market position at broker or for the strategy (as shown in the chart)?

User avatar
Anastassia
Posts: 179
Joined: 18 Jan 2010
Been thanked: 4 times

Re: Indicator Knowing What Strategy Is Doing?

Postby Anastassia » 01 Oct 2010

Hi Spaceant,

i_MarketPosition returns the market position for the strategy, while i_MarketPosition_at_Broker
returns the market position at Broker.

~~~~~

i_MarketPosition_at_Broker
Returns a numerical value, indicating the type of the specified position at the broker for the symbol.
A value of 1 indicates a long position, -1 indicates a short position, and 0 is returned only if the current position is specified and indicates that the current position is flat.


Usage
MarketPosition_at_Broker

Notes
This function can only be used in indicators.

This function differs from the marketposition keyword in that it cannot take an argument to reference past values.

This function can only be used with Interactive Brokers, Patsystems, and Zen-Fire.

Example
i_MarketPosition_at_Broker will return a 1 if the current position at the broker for the strategy is long.

i_MarketPosition_at_Broker will return a -1 if the current position at the broker for the strategy is short.

i_MarketPosition_at_Broker will return a 0 if the current position at the broker for the strategy is flat.

Thank you


Return to “MultiCharts”