Assign Initial Market Position at Broker Problem

Questions about MultiCharts and user contributed studies.
User avatar
t-rader
Posts: 139
Joined: 02 Feb 2011
Location: Australia
Has thanked: 11 times
Been thanked: 27 times

Assign Initial Market Position at Broker Problem

Postby t-rader » 06 Jan 2014

My server went down while I had a trade open and once the server was back up I used the assign Initial Market Position at Broker to tell Multicharts that I have a trade open at my broker.

I was monitoring the trade and the trade didn't exit when it was supposed. The problem being in my code I reference trade names using 'PosTradeEntryName' so when I assigned the initial market position at broker it wasn't aware of its name. This raises 2 questions:

1. Can Multicharts please create a field in the 'Assign Initial Market Position at Broker' which will allow you to name the position/trade thats still open at the broker?

2. Until Multicharts can please provide the above feature request ;) how can I best get around this problem?

Thanks,

User avatar
Andrew MultiCharts
Posts: 1587
Joined: 11 Oct 2011
Has thanked: 931 times
Been thanked: 558 times

Re: Assign Initial Market Position at Broker Problem

Postby Andrew MultiCharts » 06 Jan 2014

Hello t-rader,

1. Please leave us such feature request.
2. I'll double check this with engineers (when they are back from local public holidays), but when you use assign market position for the strategy it should be creating an artificial entry for the inner strategy calculation in auto-trading engine when automation is started. Maybe you can reference its name from your code in order to implement special logic for such case.

User avatar
t-rader
Posts: 139
Joined: 02 Feb 2011
Location: Australia
Has thanked: 11 times
Been thanked: 27 times

Re: Assign Initial Market Position at Broker Problem

Postby t-rader » 06 Jan 2014

Logged feature request here: http://www.multicharts.com/pm/viewissue ... no=MC-1571

I don't think I understand your 2nd point. Are you saying there will be a default name generated that I could possibly reference? Even if this is the case I have different exits depending on PosTradeEntryName and a default name just wouldn't work.

Thanks Andrew, I'll await to hear back from you regarding what the engineers say.

User avatar
Andrew MultiCharts
Posts: 1587
Joined: 11 Oct 2011
Has thanked: 931 times
Been thanked: 558 times

Re: Assign Initial Market Position at Broker Problem

Postby Andrew MultiCharts » 09 Jan 2014

t-rader,

Yes, you understood me correctly. The name of such order is in the attached screenshot below. I am not sure why it won't work for you: you can implement a logic that would understand if the the previous order name is Initial Entry, then auto-trading was re-started.
Image

User avatar
t-rader
Posts: 139
Joined: 02 Feb 2011
Location: Australia
Has thanked: 11 times
Been thanked: 27 times

Re: Assign Initial Market Position at Broker Problem

Postby t-rader » 09 Jan 2014

t-rader,

Yes, you understood me correctly. The name of such order is in the attached screenshot below. I am not sure why it won't work for you: you can implement a logic that would understand if the the previous order name is Initial Entry, then auto-trading was re-started.
Image
Ok I understand what you're saying but I can't see how it will work for me. Here's an example to better explain as maybe I'm missing your point.

Say you have two possible entries:

if EntryCondition1 = true buy ("tradeName1") next bar at market
if EntryCondition2 = true buy ("tradeName2") next bar at market

then say you have 2 different exits:

if ExitCondition1 = true and PosTradeEntryName(0,0) = "tradeName1" then sell next bar at market
If ExitCondition1 = true and PosTradeEntryName(0,0) = "tradeName2" then sell next bar at market

So lets say my server/multicharts goes down after an entry has occurred. Without being able to name this position using Assign Initial Market Position at broker how can I use this default name of 'Initial Entry' to have the correct exit condition considering various exit conditions based on the trade name?

User avatar
Andrew MultiCharts
Posts: 1587
Joined: 11 Oct 2011
Has thanked: 931 times
Been thanked: 558 times

Re: Assign Initial Market Position at Broker Problem

Postby Andrew MultiCharts » 10 Jan 2014

I see what you mean now. I believe that was just an example to demonstrate your situation (otherwise why would identical market order depend on different names?).

In your case a theoretical solution is to write down to a file your generated orders and next time you restart automation the strategy can bring up the latest names from the file.


Return to “MultiCharts”