CrossTrade Docs
Basic CommandsAdvanced Commands
  • Welcome!
    • Set Up Guide
  • Getting Started
    • Installation
    • User Dashboard
      • XT Control Panel
      • Manual Trader
      • Command Builder
    • Alert History
    • TradingView Alerts
      • Dynamic Variables
      • XT Alert Builder
      • Example Indicators
      • Example Strategies
    • VPS Connection Guide
  • Webhooks
    • Overview
    • Commands
      • Place Order
      • Flat Place Order
      • Close Position
      • Reverse
      • Reverse Position
      • Flatten Positions
      • Flatten Everything
      • Cancel Order
      • Cancel Orders
      • Cancel All Orders
      • Cancel Replace
      • Change Order
      • Close Strategy
    • Advanced Options
      • Multi-Account Placement
      • Flatten First
      • Require Market Position
      • Max Positions
      • Bracket Orders
      • Percentage and Tick Prices
      • Limit Order Timeouts
      • Trading Window
      • Bypass Trade Windows
      • Delay Timer
      • Rate-Limiting
      • Alert Commenting
      • Kill Switch
      • Notes
    • Examples & Use Cases
    • Troubleshooting
  • Account Manager
    • Overview
      • How It Works
      • Dashboard
      • Global Settings
      • Frequently Asked Questions (FAQ)
    • Monitors
      • Profit/Loss Thresholds
      • Minimum Profit Drawdown
      • Trailing Drawdown
      • Advanced Usage
    • Account Settings
      • Auto-Flattening
      • Trading Windows
    • Management Logs
  • NinjaTrader
    • ATM Strategies
      • Creating ATM Template
    • Optimizing NinjaTrader Performance
    • Enabling Multi-Provider Mode
  • CrossTrade API
    • Overview
    • Authentication
    • Rate Limiting
    • Webhook Trading
    • Accounts
      • GET Accounts Summary
      • GET Accounts
      • GET Account
    • Positions
      • GET Positions
      • GET Position
      • POST Close Position
      • POST Reverse
      • POST Reverse Position
      • POST Flatten Positions
      • POST Flatten Everything
    • Orders
      • GET Orders
      • GET Order
      • GET Order Status
      • POST Cancel Order
      • POST Cancel Orders
      • POST Cancel All Orders
      • POST Place Order
      • POST Flat Place Order
      • POST Replace Order
      • PUT Change Order
    • Strategies
      • GET Strategies
      • GET Strategy
      • POST Close Strategy
    • Executions
      • GET Executions
      • GET Execution
    • Quotes
      • GET Quote
  • Changelog
    • XT Versions
    • All Updates
  • Affiliate Program
    • Media Kit
  • Social Links
    • Discord
    • TradingView
    • YouTube
    • X (Twitter)
    • Instagram
    • Facebook
    • Reddit
    • Website
    • Blog
Powered by GitBook
On this page
  • Unrealized Mode
  • New Unrealized Chart Line
  • Management Reset Behavior
  • Monitor Settings Requirements
  • Unrealized Profit/Loss Thresholds
  • Require Clean Sessions
  • Consequences of Unclean Sessions
  • Allowing Unclean Sessions
  • Reasons to Disable Clean the Session Check
  1. Account Manager
  2. Monitors

Advanced Usage

Learn about advanced features available in CrossTrade Pro

PreviousTrailing DrawdownNextAccount Settings

Last updated 14 days ago

Unrealized Mode

When creating or editing a Monitor, if you choose to include unrealized profit/loss in the P&L calculation (on by default), you gain the ability to enable Unrealized Mode.

Unrealized Mode is a special setting that 1) bases all management decisions on the total unrealized P&L of all open positions in the account, and 2) prevents the Monitor from shutting off when triggered, which effectively allows you to run a Monitor continuously throughout the trading day.

This mode is compatible with Profit/Loss Thresholds, Minimum Profit Drawdown, and Trailing Drawdown based on P&L.

New Unrealized Chart Line

When Unrealized Mode is enabled, a new unrealized P&L "shadow" line will be visible on the Session Profit/Loss graph after you click on an account in the Account Management list. The unrealized shadow line is now the trigger line responsible for flatten actions or drawdown activation, whereas the solid blue line shows the overall session profit/loss.

Normally, when not in Unrealized Mode, the solid blue profit/loss line acts as the trigger line for the day's entire performance and does not reset. If Unrealized Mode is disabled, once a monitor is triggered and stopped it remains stopped for the rest of the session.

Management Reset Behavior

As you would expect, Unrealized Mode tracks the unrealized high watermark to determine whether or not stopping criteria has been met or drawdown minimums have been reached. What makes this mode special, however, is the Monitor does not get "stopped" and will remain active even after a flattening action occurs.

When a Monitor triggers a flattening event in Unrealized Mode, the high watermark of the unrealized P&L get reset to zero (can be seen in the image above). This allows the Monitor to reset with fresh tracking the moment a new position is opened.

Similarly, even if a flatten action is not triggered by the Monitor but the account is flattened and the position count returns to zero, so too will the unrealized profit/loss tracking. Any time the account goes flat, for whatever reason, tracking is reset.

Monitor Settings Requirements

There are several settings requirements that must be in place before Unrealized Mode can be used. Don't worry, the UI will yell at you if something is misconfigured.

First, all enabled Position Management actions must be set to flatten the account. A Monitor can't "Do nothing" when a Profit/Loss threshold is met. The account must be flattened so the unrealized tracking metrics can be zeroed, as discussed above.

Second, both Minimum Profit and Trailing Drawdown types are compatible with Unrealized Mode. However, Trailing Drawdown cannot be based on Net Liq and must be set to use Session P&L (i.e., unrealized profit/loss).

This precaution is necessary because otherwise, once triggered, the Monitor would continue triggering endlessly since it is never shut down in this mode.

Unrealized Profit/Loss Thresholds

After Unrealized Mode is switched on, two more options will appear for Position Profit and Position Loss thresholds. These optional settings operate almost identically to the Profit/Loss thresholds at the account-level, but they will only evaluate the unrealized P&L on individual positions in the account.

Profit/Loss thresholds for positions in Unrealized Mode are unique. They have a very high cyclic evaluation rate, checking the P&L of each position in the account every one second.

Once the position's P&L crosses above the Profit Threshold or below the Loss Threshold, the position is flattened immediately and the event is reported and logged in the Account Management logs. The Monitor will remain active and continue evaluating any other account- or position-level profit/loss settings.

Switching off Unrealized Mode or setting the Position Profit/Loss thresholds to zero will disabled the position monitor.

Position Profit/Loss Thresholds in Unrealized Mode track the true unrealized profit/loss for each position, as reported by NT8. This value excludes commissions, regardless if "Include Commission?" is set to Yes in the Monitor Settings.

Commissions only apply at the account-level and cannot be tracked at the position-level.

Require Clean Sessions

CrossTrade often has to work around NinjaTrader 8's idiosyncrasies. Chief among them is NT8's inability to query execution data beyond the current session. Because of this, the way NT8 reports unrealized and realized Day P&L is nuanced.

If a position is carried over from a previous session, i.e., held from before 5 PM ET into the open of the new session at 6 PM ET, NT8 will consider any gains from that position as part of the day's unrealized P&L. However, as soon as that position is closed, NT8 will omit that profit or loss from the calculation, making it very difficult to track the true Session P&L.

For this reason, by default we require a clean session (session opens with no active positions) for Account Management Monitors to run properly.

If the session is determined to be "unclean," the Monitor is marked as "INACTIVE" and goes into a waiting state until the next session begins. This is done for safety, as we'll see in a minute.

Consequences of Unclean Sessions

As mentioned, if the session begins with one or more positions already open, the Session P&L will be tracked accordingly and the Session's P&L high watermark will be recorded appropriately.

The moment any of those positions is closed, however, regardless if it's by the XT Monitor automation or manually, NT8 will immediately disregard the P&L outcome of that position from its Session P&L calculation.

In the example below, a single MNQ position was open at the beginning of the session, carried over through the previous close. As you can see from the P&L graph, the Session P&L is reported and tracked correctly since the start of the session.

At 7:00 AM ET, I closed the position manually for approximately a $300 profit. Then, as you can clearly see in the highlight sections, NT8 disregards the Session P&L as a result of that position and the Profit/Loss drops to zero as if it never existed in the first place.

As long as the trader is aware that this will happen, disabling the Require Clean Session check can be a viable option if your strategy requires carrying positions overnight.

Allowing Unclean Sessions

If you don't care about this safety mechanism and want to turn it off, simply click Edit on any Monitor and uncheck the "Require Clean Session" switch, then Save Changes.

Reasons to Disable Clean the Session Check

Let's discuss a few reasons why traders might consider disabling the check for clean sessions and allow Monitors to run regardless.

Intentional Strategy

The primary reason a trader might want to disable clean sessions is if he's intentionally carrying overnight risk and wants the XT Monitor to manage those positions for him.

The most cogent course of action here would be to let the Monitor handle position exits based on pre-defined P&L thresholds. Once those thresholds are hit and the Monitor's flatten action is triggered, the trader ceases trading for the day.

If the trader chooses to restart a Monitor in this scenario, he must be aware that the Profit/Loss value has now changed (perhaps dramatically) and should check it before continuing.

Erroneous Prop Firm Reporting

In some circumstances, prop firms have been known to alter/modify the execution history of prop accounts in such a way that it fools the Clean Session algorithm into thinking a position is open in the account when, in fact, no positions are open at all.

Failing the Clean Session check has most often been observed in S1* accounts. We have yet to determine why.

In this case, it may be prudent to disable the Clean Session requirement if you are certain the account will end the day flat, either through NinjaTrader Account Management or otherwise.

End-of-Day Auto-Flattening
Session Profit/Loss curve in unrealized mode
Non-zero values set and enable position profit/loss thresholds in Unrealized Mode
Exit Position event is visible in the Account Management logs
NinjaTrader Account Management monitor marked inactive
Result of unexpected drop in P&L from carried positions
Enable/Disable the check for clean sessions