Open Trade Properties Re-Load on Strategy Re-Start

Questions about MultiCharts and user contributed studies.
WHM
Posts: 7
Joined: 28 May 2015
Location: Australia
Has thanked: 13 times

Open Trade Properties Re-Load on Strategy Re-Start

Postby WHM » 19 Jul 2015

Hi,

Wondering if there's some way to save and re-load the data for strategy open trades such that Strategy Position Trade reserved words can be re-established if a strategy is turned off and then re-started?

Relevant reserved words:
url=www.multicharts.com/trading-software/in ... ion_Trades

The problem I'm running into at the moment is all open trades in a pyramid position are consolidated into 1 trade when the strategy is restarted.

For example, a position with 2 open entries may look like this:

Code: Select all

OpenEntriesCount = 2
OpenEntryPrice( 0 ) = 0.75
OpenEntryPrice( 1 ) = 0.78
OpenEntryContracts( 0 ) = 1
OpenEntryContracts( 1 ) = 2
OpenEntryMaxProfitPerContract( 0 ) = 1.10
OpenEntryMaxProfitPerContract( 1 ) = 0.15
PosTradeEntryName( 0, 0 ) = Entry_1
PosTradeEntryName( 0, 1 ) = Entry_2
But if this strategy is turned off and re-started, all of this data will be consolidated:

Code: Select all

OpenEntriesCount = 1
OpenEntryPrice( 0 ) = 0.765 ( ( 0.75 + 0.78 ) / 2 )
OpenEntryPrice( 1 ) = 0.0
OpenEntryContracts( 0 ) = 3 (assumes all contracts entered in 1 trade, i.e. 1+2)
OpenEntryContracts( 1 ) = 0
OpenEntryMaxProfitPerContract( 0 ) = 0.15
OpenEntryMaxProfitPerContract( 1 ) = 0.0
PosTradeEntryName( 0, 0 ) = 'Initial Entry' (MC default)
PosTradeEntryName( 0, 1 ) = ""
Using Global Variables here has been problematic, so if anyone can recommend a fix it'd be great!

Thanks

User avatar
JoshM
Posts: 2195
Joined: 20 May 2011
Location: The Netherlands
Has thanked: 1544 times
Been thanked: 1565 times
Contact:

Re: Open Trade Properties Re-Load on Strategy Re-Start

Postby JoshM » 20 Jul 2015

I think the new Auto Trading and Backtesting engine might do this, by providing access to the historical (backtest) trades of the strategy upon restart:
There is a feature scheduled for MC 9.1: https://www.multicharts.com/pm/viewissu ... no=MC-1497
With the help of this feature that will be possible to get the collection of orders that were generated, cancelled, filled etc by the strategy in backtesting.
Source. And here it's suggested that access to all data from the Order and Position Tracker will also be possible.

But for now, the only workaround I can think of is using ADE or ELCollections to store the data to a file, and then read it when the strategy restarts.

User avatar
Henry MultiСharts
Posts: 9165
Joined: 25 Aug 2011
Has thanked: 1264 times
Been thanked: 2957 times

Re: Open Trade Properties Re-Load on Strategy Re-Start

Postby Henry MultiСharts » 22 Jul 2015

But for now, the only workaround I can think of is using ADE or ELCollections to store the data to a file, and then read it when the strategy restarts.
That is the only solution for this inquiry at the moment.


Return to “MultiCharts”