This article explains the two buttons on a follower group header in Replikanto: Flatten (the group's ×) closes the positions and cancels the working orders of the accounts in one group that are not Off, and Rearm re-arms the Disarmed accounts of the group that are flat. It also compares them with Flatten All, the row's × and the tab's Rearm button, and covers what to do when an account stays Disarmed after a group Flatten. Follower groups are available starting with Replikanto 1.7.1.0.
Where the buttons are
- Flatten: the × in the Flatten column of the group header row.
- Rearm: a text button next to the group name. It appears only while the group has at least one Disarmed account.
1 = the group's Rearm button (it appears because Sim103 is Disarmed), 2 = the group's Flatten x button.
Both buttons act only on the accounts of that group. The leader and the other groups are not affected.
Flatten a whole group
Click the × on the group header. Its tooltip reads: "Flattens the accounts of this group that are On, Out of Sync or Disarmed, on the leader's instrument (or the account's Cross Order instrument): closes the position and cancels the working orders on that instrument. Accounts that are Off, the leader and other groups are not affected. Afterwards, the Disarmed accounts that end flat are rearmed."
- Replikanto asks first. A Yes/No window titled "Follower group 'Simulation'" (with the name of your group) says, for example: "Flatten the 3 follower account(s) in group 'Simulation' on MNQ 12-26 (or each account's Cross Order instrument)? This closes their position and cancels their working orders on that instrument. 2 of them currently hold a position or orders. Accounts that are Off, the leader and other groups are not affected." The number counts only the accounts that are not Off. The window also has NinjaTrader's Don't show this message again checkbox.
- If the leader is still in a trade, the window adds: "The leader is still in a trade; accounts you flatten stay armed and will mirror its next orders."
- Click Yes to flatten (Yes is the focused button). Clicking No, or closing the window with its X, does nothing.
The Flatten confirmation.
If you tick Don't show this message again and click Yes, the next clicks on the Flatten button of any group, in any tab, flatten the group straight away, with no window. You then no longer see how many accounts hold a position, nor the warning that the leader is still in a trade. Starting with Replikanto 1.7.2.0, that tick turns off the option Ask before a group's Flatten in Replikanto's Properties, and the Log tab shows:
Replikanto: [UI] The group Flatten's confirmation was turned off from its box ("Don't show this message again"). Turn it back on in Properties > Ask before a group's Flatten.
Only Yes with the box ticked turns the option off. Ticking the box and clicking No, closing the window with its X, or ticking and then unticking the box before clicking Yes change nothing. While the option is off, each click on a group's Flatten button writes this line in the Log tab instead of asking:
Replikanto: [UI] The group Flatten's confirmation is turned off (Properties > Ask before a group's Flatten). Going ahead.
The checkbox works like the one on the Flatten All confirmation, but the two are separate: Flatten All has its own option, Ask before Flatten All, and turning one off does not affect the other.
Starting with Replikanto 1.7.2.0, if NinjaTrader's confirmation window cannot be opened, Replikanto asks the same question in a plain Windows Yes/No box instead of doing nothing. That box appears only while Ask before a group's Flatten is on (with the option off, the group Flatten opens no window of any kind); its buttons are in your Windows language, and it has no Don't show this message again box. The Log tab then shows Warning [1132]. If no box can be opened at all, the group Flatten goes ahead, because you clicked it, and the Log shows Warning [1133]: check that the accounts really are flat.
Get the question back
Starting with Replikanto 1.7.2.0:
- Right-click anywhere in the Replikanto window and select Properties.
- In the General group, tick Ask before a group's Flatten.
- Click OK.
The option applies to every group, Replikanto tab and workspace on this computer and takes effect at once, with no restart. It is independent of Ask before Flatten All. If you had hidden this question in NinjaTrader on Replikanto 1.7.1.0 or earlier, Replikanto 1.7.2.0 keeps it hidden the first time it runs on the computer, and the Log tab shows Info [1141] with groupFlatten='off'; tick the option to get the question back. On Replikanto 1.7.2.0, editing UI.xml changes nothing: Replikanto reads that file only once, the first time 1.7.2.0 runs on the computer.
Replikanto 1.7.1.0 or earlier: To get the question back, close NinjaTrader, keep a copy of Documents\NinjaTrader 8\UI.xml, open that file in a text editor such as Notepad, delete the line <ReplikantoGroupFlatten /> inside <DoNotShowMessages>, save it and start NinjaTrader again. NinjaTrader has no option in its own windows to show the question again, and it must stay closed while you edit the file, or the change can be lost. Flatten All has its own line, <ReplikantoFlatAll />.
What it closes
- Every account of the group that has a NinjaTrader account and is not Off: On, Out of Sync and Disarmed. Starting with Replikanto 1.7.2.0, accounts that are Off are not touched, as with Flatten All. On Replikanto 1.7.1.0 or earlier, the group Flatten also closed accounts that are Off.
- Accounts with Market Only on are included.
- Never the leader account, even if it is listed in the group.
- The position and the working orders on the leader's instrument (or on the account's own Cross Order instrument, if it has one).
- Only follower accounts of this computer's list. Followers on remote nodes are not flattened by this button.
The flatten is sent to the accounts together, like Flatten All. For Rithmic accounts, Replikanto first re-reads the position from the broker, within a short wait. If that takes too long you may see a "Warning [1100]" in the Log tab and the flatten goes ahead with the position NinjaTrader currently shows.
Safety rules
- The button is disabled for at least 2 seconds while the flatten runs (up to a few seconds more while Replikanto waits for the closes to show), so a double click cannot send it twice. The group editing items (edit, rename, delete) are disabled during that time too.
- If you change the leader's instrument while the question is open and then click Yes, nothing is flattened. A message says: "The leader instrument changed while the confirmation was open, so nothing was flattened. Click Flatten again to flatten the group on the new instrument."
- If an account joined the group while the question was open, nothing is sent either. Click Flatten again.
- If the leader has no instrument selected in the tab, nothing happens, and the Log tab says there is no instrument to close.
- If the group has nothing to flatten (for example it holds only the leader account, or only accounts that are not connected), there is no question; the Log tab shows the result.
Disarmed accounts after the Flatten
A Disarmed account is re-armed by the group Flatten only if its position reads flat afterwards. Flatten only guarantees that the close order was sent, not that it filled. If the account still shows a position (or its position cannot be read), it stays Disarmed and the Log tab shows:
Warning [1125] Flatten Group left this follower Disarmed because it still shows an open position, or its position could not be read; check it by hand, then re-arm it from the Rearm button.
Check the account in NinjaTrader. When it is flat, click the group's Rearm button or the tab's Rearm button. A Disarmed account never re-arms by itself later.
Starting with Replikanto 1.7.2.0, the row's × follows the same rule: it re-arms a Disarmed account only once it reads flat, and if the account still shows a position about 15 seconds later it stays Disarmed and the Log tab shows Warning [1140]. Unlike Flatten All (Warning [1073], Info [1135]), neither the row's × nor the group Flatten looks at the leader's position: a Disarmed account that reads flat is re-armed even while the leader is still in a trade.
Rearm a whole group
Click Rearm on the group header. Its tooltip reads: "Rearm the Disarmed accounts of this group that are flat. A Disarmed account that still holds a position stays Disarmed."
- Disarmed accounts that are flat are re-armed (they go back to On).
- Disarmed accounts that still hold a position (or whose position could not be confirmed) stay Disarmed. A window lists them: "Still Disarmed: they hold a position, or being flat could not be confirmed. Flatten it, or use the tab's Rearm button".
- Rearm does not send any order. It only changes the status of the accounts.
- It is blocked while a Flatten of the same group is running.
When no account of the group is Disarmed, the Rearm button is not shown.
Turn On, Turn Off or Flatten several selected followers
Starting with Replikanto 1.7.2.0 you can act on several follower accounts without a group. Ctrl+click or Shift+click rows in the followers list, then right-click one of the selected rows. The menu items act on every selected follower row (group headers are left out). A right-click on a row outside the selection acts only on that row. With two or more accounts selected, three items appear at the top of the menu, for example Turn On 4 accounts, Turn Off 4 accounts and Flatten 4 accounts. Their windows are titled "Selected follower accounts (4)".
- Turn On N accounts: turns on only the selected accounts that are Off. It never re-arms a Disarmed account (use Rearm for that). It is gray when none of the selected accounts is Off.
- Turn Off N accounts: turns Off the selected accounts, Disarmed and Out of Sync ones included. If some of them hold a position or working orders, Replikanto asks first. It is gray when all the selected accounts are already Off.
- Flatten N accounts: flattens the selected accounts that are On, Out of Sync or Disarmed, on the leader's instrument (or each account's Cross Order instrument): it closes the position and cancels the working orders on that instrument. Accounts that are Off, the leader and the accounts not selected are not affected. The Disarmed accounts that end flat are rearmed.
Turn On and Turn Off follow the same plan, ask the same questions and give the same report as the Status dot on a group header (see Apply a setting to a whole follower group at once). If some selected accounts did not change, a message lists them under "Selected accounts: accounts changed: N. Accounts not changed:".
Flatten N accounts follows the rules of the group Flatten described above: the question appears only while Ask before a group's Flatten is on, a Disarmed account is rearmed only if it reads flat, and if you change the leader's instrument while the question is open, nothing is flattened and you click Flatten again. The item is gray while that Flatten is still running.
Which button does what
| Button | What it closes | Accounts that are Off | Leader | Disarmed accounts afterwards |
|---|---|---|---|---|
| Flatten All (the tab's button) | The leader and every follower that is not Off | Not touched | Closed | Re-armed only if the position reads flat (otherwise Warning [1073]) |
| × in an account row | That one account | Disabled (gray) on an Off row | Not applicable | Re-armed once it reads flat; stays Disarmed (Warning [1140]) if it still shows a position about 15 seconds later. On 1.7.1.0 or earlier: always re-armed, about 2 seconds after the click |
| × in a group header | Every account of the group that is not Off, after a question | Not touched (on 1.7.1.0 or earlier: closed too) | Never closed | Re-armed only if the position reads flat (otherwise Warning [1125]) |
| Rearm (the tab's button) | Nothing | Unchanged | Unchanged | All re-armed, with or without a position |
| Rearm in a group header | Nothing | Unchanged | Unchanged | Only the flat ones are re-armed; the others stay Disarmed and are listed |
For the full behavior of Flatten All, see the article "Why doesn't the "Flatten All" button work?".
Troubleshooting
The account is still Disarmed after I flattened the group
It still showed a position when Replikanto checked, or its position could not be read. Look for Warning [1125] in the Log tab. Confirm in NinjaTrader that the account is flat, then click the group's Rearm button or the tab's Rearm button.
The group's Flatten button is gray
Either a group Flatten is running (wait a few seconds), the group has no account with a row in the list (for example all of its accounts are disconnected), or every account of the group is Off.
I clicked the Flatten button and nothing happened
Check that the leader has an instrument selected in the tab. Without one the button does nothing and the Log tab explains it. If a question appeared and you chose No or closed it, nothing is sent.
The Rearm button is not on the header
It appears only while at least one account of the group is Disarmed. If you do not see it, none is.
The account I flattened is still copying
That is expected. A group Flatten closes the position and the working orders, but the account keeps its status. An account that is On stays armed and mirrors the leader's next orders. To stop copying to it, turn it Off.
Related articles
- Follower groups in Replikanto: by connection or custom: what groups and headers are.
- Apply a setting to a whole follower group at once: the other header actions.
- Create, edit and delete custom follower groups: building your own groups.
- Why doesn't the "Flatten All" button work?
Comments
0 comments
Article is closed for comments.