+1 888 340 6572
MultiCharts Project Management
previous_open_issue.png
Go to the previous open issue
previous_issue.png
Go to the previous issue (open or closed)
star_faded.png
Please log in to bookmark issues
bug_report_small.png
Open Bug report MC-2369

Errors in position handling on OandA account

action_vote_minus_faded.png
1
Votes
action_vote_plus_faded.png
next_issue.png
Go to the next issue (open or closed)
next_open_issue.png
Go to the next open issue
Description

Hi guys

I've tested a few scenario's in adopting the position at the broker for a set of instruments using an OandA account and picked up some issues. The first issue is adopting the initial position and the second is that MC does not correctly close an adopted position. I've used a demo (fxPractice) account to test these issues that have the standard "Primary account" and then a "Multicharts account" sub-account defined on the broker side.

First issue - Adopting initial positions: All the strategies are configured to trade on the "Multicharts account" sub-account and I've tried to both assign positions manually using the "Initial Market Positions" dialogue and just automatic adoption without the "Initial Market Position" dialogue, neither work if you have access allowed to both the "Primary account" and "Mutlicharts account" when you authenticate/login at the broker. It should not matter whether I have access granted to both accounts, the selected account in the "Autotrading" properties should dictate which positions are adopted and which are not. Positions are correctly adopted when only the "Mutlicharts account" sub-account is selected for allowed access at authentication. As a final note, the open position is on the "Multicharts account" and not the "Primary account" the primary account is flat so I think the error is caused by MC getting confused between the positions retrieved for the "Primary account" and the "Multicharts account" and even though it's instructed to trade/adopt positions in the "Multicharts account" it does not do so correctly.

Second issue - Closing a position does not work: Once a position is open whether it is a strategy position or an adopted position you have the option to close the position on the "Orders and Position Tracker->Positions" tab. When you right click and select to close the position, the position would disappear on that specific tab but when you go to the "Portfolio Real-time Auto Trading" tab you'll see that the position is still there. Additionally, I check the position using the OandA app on my phone and it was still there, it was not closed.

Third issue - Autotrading and data selection: Depending on your selection of the "Data Range" on the "Data" tab in portfolio trader, when you enter autotrading mode, portfolio trader would not submit trades if the "Data Range" selection is not set to the first option. If you've been back testing using some historical data range and then enter autotrading mode if you have not selected the first option, e.g. "500 Bars back/Days back from <CURRENT DATE>" you would not get any trades submitted. I think that irrespective of your "Data Range" selection when you enter autotrading mode (or forward testing for that matter) the current date and latest data should always be used, the "Data Range" selection becomes irrelevant.

Thank you in advance for looking into these issues.

Kind regards
Ettienne Hugo

Steps to reproduce this issue

First issue:

Test 1:
1. Create an OandA demo account, additionally create one sub-account.
2. Setup a test portfolio to trade the sub-account.
3. Open a position on one of the instruments in the portfolio within the created sub-account.
4. Configure autotrading for the test strategy to use the sub-account created and set the strategy to adopt the broker position.
5. Start autotrading.
6. On the OandA logon dialogue select BOTH accounts for allowed access.
7. Check that the initial market position was correctly adopted. <--- This does not work.

Test 2:
1. Stop autotrading, close MC so that it disconnects from the broker and do not close any test positions at the broker.
2. Restart portfolio trader and load the test portfolio.
3. Keep settings the same for the test strategy as was set in Test 1.
4. Start autotrading.
5. On the OandA logon dialogue select only the sub-account assigned to the test strategy.
6. Check that the initial market position was correctly adopted. <--- This will work.

MC should correctly adopt positions as long as it has the correct access to the account it specifically needs to trade, more access should not break it.

Second issue:

It's best to test this in conjunction with the OandA mobile app connected to your demo test account.
1. Stop autotrading if it's still running.
2. Ensure that you have recalculation on broker events correctly configured, I select recalculation on ALL the broker events. Additionally, select to have entries/exits based on confirmation by the broker (synchronous).
3. Open a position on the test account using the OandA mobile app or web-app.
4. Start auto trading and adopt the current open position into the test strategy.
5. Go to the "Orders and Position Tracker->Positions" tab.
6. Select the open position, right click and select to close the position. The position should disappear, "pretending" to be gone ;-)
7. Go to the "Portfolio Real-Time Auto Trading"' tab.
8. The instrument will still reflect the open position, double check your position using the OandA mobile app, you'll see that the position is still present so the "Portfolio Real-Time Auto Trading" is correct while the "Orders and Position Tracker->Positions" tab is wrong.

Third issue:

This issue might take some time since you have to wait for a trade signal, it might be best to test it on a 1-minute timeframe with a pretty active signal.

Test 1:
1. Select the "Data range" in portfolio trader to be some other date range than the present, e.g. from 1 Jan 2008 to 31 Dec 2016 (does not include current date).
2. Configure your trade signal on the high frequency time frame.
3. Start autotrading, you'll see that no trades are submitted to the broker.

Test 2:
1. Stop auto trading and select a "Data range" that includes the current date for say 500 bars back.
2. Restart autotrading, you should now receive signals.

Signals should be submitted to the broker in autotrading mode irrespective of Data range.

Comments (2)
#1
user-offline.png  MultiCharts Support (MultiCharts)
Nov 10, 2017 - 09:56
Hello Ettienne,

Let me address your issues in order: Issue #1 — "Assign the Initial Market Position..." doesn’t operate with the sub-account and send the orders to the main account — unfortunately, this one was not reproduced on our side, so please come to our Live Chat (accessible from our website www.multicharts.com from the upper part of it) Mon-Fri from 6:30 AM to 12:00 PM EST (11:30 AM to 5:00 PM GMT) to demonstrate this issue by remote connection.

Issue #2 — Open Positions tab in the Order and Position Tracker displays real positions opened at the broker. Strategy Positions tab displays those positions that exist within the autotrading engine – the positions that the strategy knows about and that it controls. A strategy position may not always match the broker position, e.g if you combine autotrading with manual trading on one and the same instrument as in your example. Please refer to this article for more information: https://www.multicharts.com/trading-software/index.php/Why_There_Is_Mismatch_On_Strategy_Positions_Tab As for this part - When you right click and select to close the position, the position would disappear on that specific tab but when you go to the "Portfolio Real-time Auto Trading" tab you'll see that the position is still there. Additionally, I check the position using the OandA app on my phone and it was still there, it was not closed - I’m afraid this is also not reproduced on our side, so please come to Live Chat to demonstrate this as well.

Issue #3 — in autotrading Portfolio Trader would not submit orders if the "Data Range" selection is not set to the current date — this is predetermined behavior that replicates the behavior on charts. For the orders to be generated there has to be the necessary amount of history for strategy’s calculation, and as the orders are generated on one bar and sent on the next, then the there has to be the most recent history for the strategy’s functioning.
Changes:
  •   icon_status.pngStatus changed: Under Review => Need Details
#2
user-offline.png  Ettienne (et1hugo)
Nov 16, 2017 - 04:24

Hello Alex

Thank you very much for the feedback, I'll be out of the US until the new year but will look to contact you concerning the first issue where the initial market position is not adopted on a OandA sub-account.

Kind regards
Ettienne Hugo

History
Issue basics
  • Type of issue
    Bug report
  • Category
    Not determined
  • Targeted for
    Not determined
  • Status
    Not a bug
  • Priority
    Not determined
User pain
  • Type of bug
    Not triaged
  • Likelihood
    Not triaged
  • Effect
    Not triaged
Affected by this issue (0)
There are no items
People involved
Times and dates
  • Posted at
  • Last updated
Issue details
  • Reproducability
    Not determined
Attachments (0)
There is nothing attached to this issue
Commits (0)
There are no code checkins for this issue
Duplicate issues (0)
This issue does not have any duplicates