· Introduction · 13 min read

Auto-add commssions, fees, targets to your trades: Automation using commissions and fees profiles in TradesViz

Auto-add commssions, fees, targets to your trades: Automation using commissions and fees profiles in TradesViz
By TradesViz in Introduction

One of the first stark differences most traders notice after importing their trades into TradesViz is the difference between net and gross PnL. Often, this cannot be avoided so it is thought of as a "business expense" for traders. Commissions-free era has made this even easier on traders' accounts, but this is still part of your analysis and cannot be ignored.

The disappointing part is that most brokers/platforms still don't report commissions/fees properly in the export statements - often, it's completely missing. Let's not even go to the targets (stop loss, profit targets) data... 

With this being the current situation, how can traders get a 100% accurate grasp of their PnL and thus get insights that are more in line with the type of trading that a trader does? 

At TradesViz, we've had account-level commissions and targets almost since our launch in 2019 and this has greatly helped a lot of users. But now, we've grown to support ~150+ brokers and the demand for even finer control of commissions and fees for asset type is at an all-time high.

We will first summarize what was already possible in TradesViz. It is possible to add commissions and targets (stop/profit) on an asset-type basis for any individual trading account in TradesViz via the trading account settings.

By clicking on "Edit account details", you can edit the per-asset type commissions, fees, and even targets based on certain criteria:

 

      

For example, the following cases are possible for commissions/fees:

  • Add a constant commission/fee of 0.99 to all executions
  • Add a constant commission/fee of 0.0001 to each share traded
  • Add a constant commission/fee of 0.99 to all future contracts traded (each side)
  • Add a per-lot commission of 5.0 to all forex trades

 and more...

The following example cases are possible for setting targets:

  • Add a fixed 4 point profit target and 3 point stop loss for all trades
  • Add 2% of account value as stop to all trades
  • Add a constant $100 as profit and/or stop to all trades

 and more...

All you had to do was set this up once, save the settings and head over to the import or auto-import page, and make sure to check on the "use account-based commissions/fees" settings to make sure TradesViz uses these settings instead of the broker-provided ones.

That's it! TradesViz automatically adds the values to your imported trades/executions and you now have pnl information WITH commissions and targets for ALL your imported trades!

But, this has now become a bit limited for many users. Some downsides are:

  • You can only apply this per asset type and not per symbol
  • This will apply to all imports - so if you select different accounts and want to use account-based commissions only for certain accounts, it is not possible. 
  • It's not possible to define commissions as a formula or as a function of volume, price, and side.

 

Today, we introduce advanced commissions and fees profiles to overcome all of these issues.

In the trading account settings page, you will now notice a new button named "Advanced commissions/fees settings". Click on that to open a popup where you can add commission profiles to the account you have selected. 

Commissions & Fees profiles are certain rules and conditions that can be applied during the import process that helps assign commissions and fees to your trades in a very specific manner.

For example, the profile shown below assigns a commission of 0.49 and fees of 0.0015 to all imported executions with the symbol that begins with the characters "MES". "MES*" means "match any symbol that starts with MES and ends with anything" so this matches ALL micro ES future contracts like MESU24, MESM22, MESZ20, etc., 

 

Instead of being able to only assign specific commissions and fees to entire asset types (future in this case), you can now control exactly to what asset type and what symbol you want to add the commissions/fees to.

Here are more examples using even variables such as "vol" and "price":

As with a lot of TradesViz features, you will immediately notice the versatility and utility of this function - you can add specific commissions and fees to specific symbols or symbols with specific names or even types with advanced commission profiles. 

You no longer need to depend on your broker for accurate commissions/fees reporting. As long as you understand what commissions and fees are being applied, add them as a profile and start importing your files and TradesViz will automatically do the job of calculating the fees/commissions and add them to you executions.

  • Using this feature, some following use cases that were previously not possible but are now possible include (but are not limited to):
  • Adding commissions/fees to specific future contracts based on name matching 
  • Adding commissions/fees to specific options contracts based on name matching 
  • Adding commissions/fees as a function of price, volume, and any arithmetic formula 
  • Adding multiple commissions profile to the same account
  • Overriding the original account-based settings and using advanced commissions profile for every sync/import for a specific account (irrespective of import settings) 

etc., 

A few notes on name matching and formulas:

The following are some examples that you can enter in the symbol field of a commissions/fees profile:

  • MESU23: Match exactly "MESU23" symbol
  • MES*: Match any symbol that starts with "MES"
  • CL*, GC*: Match any symbol that starts with "CL" or "GC"
  • *USD: Match any symbol that ends with "USD"
  • *: Match any symbol
  • NIFTY50, SILVER, GOLD: Match either NIFTY50 or SILVER or GOLD

These are just examples to help you understand the format of how you can input symbols.

Remember: A commission/fee profile is added or used on an execution only if ALL 3 conditions: asset type match, symbol match, and side match are satisfied.

For the fees/commissions field, you can either enter numbers like 0.1, 1, 0.56, 0.00001, etc., or even arithmetic expressions so better reflect and understand your broker's fees/comms structure like: 0.1 + 0.0005*100, etc., 

It is also possible to include 2 variables: price, vol (use these names exactly). For example, forex and crypto trades are usually charged based on the total amount traded. In such cases, entering something like price*vol*0.005 would be the ideal solution.

Another example is if you want to add commissions per quantity - for example, for each contract of futures or options (or any asset), you can enter vol*0.5. For an execution with a quantity/volume of 5, the total commission would be 5*0.5 = 2.5.

Since it's possible to enter multiple commissions/fees profiles, you can enter one profile for the buy side and another for the sell side to be very precise on your commissions/fees data when you view them in your dashboard. 

Remember: Once you add change or delete a profile, none of the changes are applied to the current trades. They are applied only for the trades that are imported AFTER you make your changes. 

Finally, remember to check "Override all other commissions settings" at the bottom of the advanced commissions and fees popup if you want this to be used on all imports.


Note: You can apply your advanced commissions/fees profiles to ALL trades in any trading account at any time by clicking on the "Apply settings now" button at the bottom of the advanced commissions/fees profile setup box. This means you do not need to re-import your trades! Simply edit profiles > apply them to your trades at any time!


For now, this concept is applicable only to commissions and fees. Based on your feedback, we will come up with a mechanism/feature that's robust enough to handle stops and targets with the same level of flexibility that the advanced commissions/fees now offer.

With this feature, you don't need to worry about your broker's lack of commissions/fees data or even inaccurate commissions/fees data because it's now possible for you to precisely set commissions/fees on an extremely fine-grained level on a trade-level and account-level basis on TradesViz.

Remember that, if you want to see your NET pnl (i.e pnl after deducting commissions and fees), you need to toggle the "Net" option in the global filters:

We hope this feature helps you get closer to the actual amounts of profits and losses that your broker reports for any case/scenario/symbol. 


May 15th Update: Min/Max operators

This has gotten so much positive feedback and usage since we released it and we are hoping to bring this to many other parts of TradesViz also to fully automate trade data input! We are thankful for everyone's feedback!

As part of a feature request, we have added support for min/max operators. This means you can now create expressions like:

min(price*vol, 10000)*0.001

This is extremely useful for crypto and traders from countries/exchanges/brokers where the fee or commissions have a flat rate OR operate as a function of price and volume/quantity. 


Formula reference and case studies

Because broker/platform statements can split costs into brokerage, exchange fees, regulatory charges, taxes, stamp duty, clearing fees, option exercise fees, and more, the most reliable way to build a profile is to map each line item from your broker statement to a formula component.

Supported variables:

Variable Also accepted Meaning Example
price p Execution price in the execution's native currency. price*vol*(0.1/100)
vol volume, qty, quantity, v Execution quantity/volume as stored in TradesViz. vol*0.65

For stocks this quantity is usually shares. For futures and options this is usually contracts, but broker imports can vary by market and platform. If your broker statement calculates a fee using a lot size or contract multiplier and TradesViz quantity is shown as contracts, include the multiplier directly in the formula. For example, a US stock option premium-value fee may need price*vol*100*(0.002/100) rather than price*vol*(0.002/100).

Syntax note: Always include multiplication signs. pricevol(0.1/100) is not valid formula syntax. Use price*vol*(0.1/100).

Supported operators/functions: You can use +, -, *, /, parentheses, min(a,b), and max(a,b). Standard math functions such as floor, ceil, and sqrt are also available, though most broker fee schedules only need arithmetic plus min/max. Use ** for power if needed. Do not use ^ as a power operator.

Common formula patterns:

Broker statement says... Formula pattern Example
Flat fee per matching execution amount 20
Per share or per contract vol*rate vol*0.65
Percentage of turnover/notional price*vol*(rate/100) price*vol*(0.1/100)
Base ticket fee plus per-contract fee base + vol*rate 1 + vol*0.65
Minimum fee max(calculated_fee, minimum) max(vol*0.005, 1)
Capped fee min(calculated_fee, cap) min(price*vol*(0.1/100), 25)
Minimum and maximum together min(max(calculated_fee, minimum), cap) min(max(vol*0.005, 1), price*vol*(1/100))
Tax on a group of fees (component1 + component2)*(tax_rate/100) (20 + price*vol*(0.03503/100))*(18/100)

Formula values are calculated per execution. A plain number like 20 means 20 per matching execution row. If your broker charges once per order and a single order is split into multiple fills/executions, check the execution rows in TradesViz before using a flat formula.

Case study: US stocks

If a stock broker charges 0.005 per share, minimum 1.00, capped at 1% of trade value, use:

  • Asset Type: stock
  • Symbol: *
  • Side: Buy or Sell
  • Commissions to apply: min(max(vol*0.005, 1), price*vol*(1/100))
  • Fees to apply: 0

If a regulatory fee applies only on sells and is charged as 0.00278% of sale proceeds, create a separate sell-only profile:

  • Asset Type: stock
  • Symbol: *
  • Side: Sell Only
  • Fees to apply: price*vol*(0.00278/100)

Case study: Stock options

For a simple per-contract options commission of 0.65 per contract:

  • Asset Type: stock_option
  • Symbol: *
  • Side: Buy or Sell
  • Commissions to apply: vol*0.65
  • Fees to apply: 0

If the broker charges a base ticket fee plus a per-contract amount, use 1 + vol*0.65. If exchange/regulatory fees are also charged per contract, put them in the fees field, for example vol*0.03.

For option fees based on premium value, include the option multiplier if your quantity is contracts. For example, a 0.002% fee on US stock option premium value can be entered as:

  • Fees to apply: price*vol*100*(0.002/100)

Exercise and assignment fees are harder to automate. The formula fields do not know whether an option was exercised, assigned, expired, or closed normally, and they do not receive strike, expiry, underlying price, or intrinsic value. Only use a profile for exercise/assignment charges if those rows can be reliably identified by asset type, side, or symbol pattern. Otherwise, handle those statement lines separately so they do not get applied to every regular option trade.

Case study: Futures and futures options

Futures commissions are often per contract per side. Use separate symbol-root profiles when rates differ between products:

  • Asset Type: future
  • Symbol: ES*
  • Commissions to apply: vol*2.50
  • Fees to apply: vol*1.40
  • Asset Type: future
  • Symbol: MES*
  • Commissions to apply: vol*0.50
  • Fees to apply: vol*0.35

For futures options, use the future_option asset type if the rate differs from regular futures:

  • Asset Type: future_option
  • Symbol: ES*
  • Commissions to apply: vol*1.25
  • Fees to apply: vol*0.60

For futures roots, put the wildcard after the root, such as ES*, MES*, NQ*, or MNQ*. Avoid broad patterns like *ES* when micro and regular products need different rates.

Case study: Forex and crypto

If a forex broker charges 7.00 per standard lot and TradesViz quantity is in units, use:

  • Asset Type: forex
  • Symbol: *
  • Commissions to apply: vol/100000*7

If quantity is already shown in lots, use vol*7.

For crypto or forex fees based on notional value, use price*vol. Example for a 0.10% crypto fee:

  • Asset Type: cryptocurrency
  • Symbol: *
  • Fees to apply: price*vol*(0.10/100)

If there is a minimum or cap, wrap the formula:

  • Minimum fee: max(price*vol*(0.10/100), 0.01)
  • Capped fee: min(price*vol*(0.10/100), 25)

Case study: Indian options fee structure

Indian options can include brokerage, STT/CTT, transaction charges, GST, SEBI charges, and stamp duty. Always verify the exact rates from your broker/platform because exchange and regulatory rates can change.

Assume the following example structure:

  • Brokerage: flat Rs. 20 per matching execution
  • STT/CTT on options sell-side premium: 0.1%
  • NSE transaction charges on premium: 0.03503%
  • BSE transaction charges on premium: 0.0325%
  • SEBI charges: Rs. 10 per crore of turnover
  • GST: 18% on brokerage + SEBI charges + transaction charges
  • Stamp duty on buy side: 0.003%

If you want brokerage stored in the commission field, create a buy/sell profile:

  • Asset Type: index_option or the matching option asset type in your account
  • Symbol: NIFTY*, BANKNIFTY*, or the pattern that matches your imported symbols
  • Side: Buy or Sell
  • Commissions to apply: 20

Then create an NSE sell-side fees profile:

  • Side: Sell Only
  • Fees to apply: price*vol*(0.1/100) + price*vol*(0.03503/100) + price*vol*(10/10000000) + (20 + price*vol*(0.03503/100) + price*vol*(10/10000000))*(18/100)

Create an NSE buy-side fees profile:

  • Side: Buy Only
  • Fees to apply: price*vol*(0.03503/100) + price*vol*(10/10000000) + price*vol*(0.003/100) + (20 + price*vol*(0.03503/100) + price*vol*(10/10000000))*(18/100)

For BSE options in this example, replace 0.03503 with 0.0325. If your TradesViz option quantity is contracts but your broker statement calculates premium turnover using a lot size, include that lot size directly, such as price*vol*50*(0.03503/100).

STT/CTT on exercised bought options can be based on intrinsic value. The formula engine does not have strike price, settlement price, or intrinsic value as variables, so it cannot calculate that charge automatically for normal option executions. Do not add price*vol*(0.125/100) to every buy option trade unless your broker statement confirms that the same calculation applies to every matching buy execution.

Case study: Indian stocks and futures

For stock or futures brokerage charged as 0.03% of turnover capped at 20:

  • Commissions to apply: min(price*vol*(0.03/100), 20)

If stamp duty applies only on buys at 0.015%, create a buy-only profile:

  • Side: Buy Only
  • Fees to apply: price*vol*(0.015/100)

For futures where quantity is contracts and the broker statement uses a lot size of 50, include the lot size:

  • Commissions to apply: min(price*vol*50*(0.03/100), 20)
  • Fees to apply: price*vol*50*(0.0019/100) + price*vol*50*(10/10000000)

The 0.0019 transaction rate above is only an example. Replace it with the actual rate from your broker/platform.

How to validate a profile against your statement

  1. Pick one execution from your broker statement where price, quantity, side, and symbol are clear.
  2. Open the same execution in TradesViz and confirm the imported price and vol.
  3. Calculate every fee component manually once using the same values.
  4. Translate each component into a formula. Use price*vol for turnover, vol*rate for per-contract/share charges, and min/max for caps and minimums.
  5. Use separate buy and sell profiles when charges differ by side.
  6. Use separate symbol profiles when rates differ by instrument, exchange, contract size, or product.
  7. After saving, use Apply Settings Now if you want to update existing trades in that account.
  8. Compare Net PnL, total commissions, and total fees against your broker statement. Then check the Commissions & Fees charts to confirm costs look reasonable by day, month, symbol, and asset type.

When using advanced profiles to override broker/import data, make sure your profiles cover all costs you want to keep for that account. The profile-calculated values are the values TradesViz will use for matching executions.


We are constantly updating TradesViz v2.0 and these are all features we have implemented based on conversations with traders and users of TradesViz. We would highly appreciate your feedback, input, and ideas! Please us know if you have any questions by emailing us at [email protected].

Found this useful?

Share this with a trader friend, or start your own free trading journal.