TL;DR
Size spot crypto in fractional units and include fees as separate cash flows. The BTC example spends $9,500 plus a $66.50 fee from a $10,000 account, then needs two recorded sale fills to close all units. An empty-position entry guard prevents repeated purchases. A weekly $150 accumulation rule serves a different purpose and holds its purchases through the test; inspect quantities rather than inferring a complete exit from one sale.
Follow the fractional quantity and its fee

Show the table · 3 rows, 7 columns
Scroll sideways to compare all columns. Select a heading to sort.
| 2024-01-01T14:30:00.000Z | BTC-USD | Buy | 0.22279508898062086 | $42640.08 | $42640.08 | $66.50 |
| 2024-01-14T21:00:00.000Z | BTC-USD | Sell | 0.22123552335775648 | $42505.61 | $42505.61 | $65.83 |
| 2024-01-15T14:30:00.000Z | BTC-USD | Sell | 0.001559565622864384 | $42474.15 | $42474.15 | $0.46 |
No matching rows. Clear the filter to see all records.
The opening notional is 0.22279508898062086 BTC × $42640.08 = $9,500.00. At the declared 0.7% rate, its calculated fee rounds to $66.50, matching the recorded $66.50. The following sale fills together close 0.22279508898062086 BTC. All three displayed fees sum to $132.79.
The entry uses 95% of buying power, and fees are a separate cash flow. Read both exit fills rather than assuming the first sale closed every fractional unit. The full source retains the remaining orders and their timestamps.
Read the empty-holding guard and complete exit rule
Entry
Price > SMA(50, Day) AND position value = 0
Exit
Price <= SMA(50, Day) AND position value > 0
Allocation
95% of buying power per entry; sell 100% of held units on exit
Pair
BTC-USD
Execution
Market; fractional units enabled
Starting capital
$10,000; no additional deposits
Show the table · 6 rows, 2 columns
| Decision | Saved rule |
|---|---|
| Entry | Price > SMA(50, Day) AND position value = 0 |
| Exit | Price <= SMA(50, Day) AND position value > 0 |
| Allocation | 95% of buying power per entry; sell 100% of held units on exit |
| Pair | BTC-USD |
| Execution | Market; fractional units enabled |
| Starting capital | $10,000; no additional deposits |
No matching rows. Clear the filter to see all records.
This example trades BTC-USD as a spot Cryptocurrency asset. The saved rules were read back and verified with automated trading off.
Size fractional units
The entry/exit examples allocate 95% of buying power and enable fractional units. The PositionValue = 0 entry check waits until the coin position is empty. The sell rule closes 100% of current positions when its exit condition is true. Inspect sent quantities and the remaining holdings in the events.
Separate accumulation from entry and exit
The weekly BTC accumulation example buys $150 when at least seven days have passed since the last filled purchase. It uses the original $10,000 cash balance without additional deposits and holds the accumulated units through the end of the test.
Inspect the exit
Follow the SellSignal and subsequent Filled orders, then compare sold quantities with holdings. Explore fees and remaining cash before the next entry. Save a changed allocation or exit as a separate experiment so its results can be compared.
No comments yet.