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?
Indicator Knowing What Strategy Is Doing?
- furytrader
- Posts: 354
- Joined: 30 Jul 2010
- Location: Chicago, IL
- Has thanked: 155 times
- Been thanked: 217 times
- Anastassia
- Posts: 179
- Joined: 18 Jan 2010
- Been thanked: 4 times
Re: Indicator Knowing What Strategy Is Doing?
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
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
- furytrader
- Posts: 354
- Joined: 30 Jul 2010
- Location: Chicago, IL
- Has thanked: 155 times
- Been thanked: 217 times
- Anastassia
- Posts: 179
- Joined: 18 Jan 2010
- Been thanked: 4 times
Re: Indicator Knowing What Strategy Is Doing?
Is this returning the market position at broker or for the strategy (as shown in the chart)?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
- Anastassia
- Posts: 179
- Joined: 18 Jan 2010
- Been thanked: 4 times
Re: Indicator Knowing What Strategy Is Doing?
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
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