<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Alpha Charts</title>
    <description>The latest articles on DEV Community by Alpha Charts (@alphacharts).</description>
    <link>https://dev.to/alphacharts</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F4271413%2F088ce35d-7fea-4075-a32d-a91b2692ae66.png</url>
      <title>DEV Community: Alpha Charts</title>
      <link>https://dev.to/alphacharts</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/alphacharts"/>
    <language>en</language>
    <item>
      <title>How many micros can I trade on a 50K account?</title>
      <dc:creator>Alpha Charts</dc:creator>
      <pubDate>Sat, 28 Nov 2026 22:29:41 +0000</pubDate>
      <link>https://dev.to/alphacharts/how-many-micros-can-i-trade-on-a-50k-account-49m3</link>
      <guid>https://dev.to/alphacharts/how-many-micros-can-i-trade-on-a-50k-account-49m3</guid>
      <description>&lt;p&gt;Your firm's plan sets the most you may hold on a 50K. The size you choose decides how fast an attempt ends.&lt;/p&gt;

&lt;p&gt;We ran one MNQ opening range breakout at 1, 2, 3, 4 and 5 micros through back-to-back example evaluations over two years: a $50,000 account, a $3,000 target, a $2,000 drawdown under the highest closing balance and a $1,000 daily loss.&lt;/p&gt;

&lt;p&gt;At every size some attempts reached the target: 3 of 13 at 1 micro, 14 of 45 at 2 and 46 of 137 at 5. Most ended on the drawdown: 10 at 1 micro and 91 at 5. At the median an attempt that reached the target took 43 sessions at 1 micro and 3 at 5. You decide what size to trade.&lt;/p&gt;

&lt;p&gt;The size did not change what the strategy made per micro. One micro lost $125 over the two years: it made $8,255 to 23 February 2026 and lost $8,380 from 24 February 2026. Five micros made and lost five times as much. What grew was the day: the worst day lost $749 at 1 micro and $3,745 at 5 micros. That is more than the whole $2,000 drawdown.&lt;/p&gt;

&lt;h2&gt;
  
  
  Each size in the rules check
&lt;/h2&gt;

&lt;p&gt;Each example evaluation starts at $50,000 on a futures day. It reaches the target at $3,000 up. It ends on the drawdown when the balance touches its floor at any point in a bar. The floor sits $2,000 under the highest closing balance and stops rising at the start. A day down $1,000 is stopped and the attempt goes on the next day. The next attempt starts on the futures day after one ends. These are example numbers.&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;SIZE&lt;/th&gt;
&lt;th&gt;ATTEMPTS FINISHED&lt;/th&gt;
&lt;th&gt;REACHED THE TARGET&lt;/th&gt;
&lt;th&gt;ENDED ON THE DRAWDOWN&lt;/th&gt;
&lt;th&gt;ATTEMPTS PER TARGET&lt;/th&gt;
&lt;th&gt;SESSIONS TO THE TARGET&lt;/th&gt;
&lt;th&gt;SESSIONS TO THE DRAWDOWN&lt;/th&gt;
&lt;th&gt;DAYS THE DAILY LOSS STOPPED&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;1 micro&lt;/td&gt;
&lt;td&gt;13&lt;/td&gt;
&lt;td&gt;3&lt;/td&gt;
&lt;td&gt;10&lt;/td&gt;
&lt;td&gt;4.3&lt;/td&gt;
&lt;td&gt;43&lt;/td&gt;
&lt;td&gt;34&lt;/td&gt;
&lt;td&gt;0&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;2 micros&lt;/td&gt;
&lt;td&gt;45&lt;/td&gt;
&lt;td&gt;14&lt;/td&gt;
&lt;td&gt;31&lt;/td&gt;
&lt;td&gt;3.2&lt;/td&gt;
&lt;td&gt;7.5&lt;/td&gt;
&lt;td&gt;9&lt;/td&gt;
&lt;td&gt;12&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;3 micros&lt;/td&gt;
&lt;td&gt;76&lt;/td&gt;
&lt;td&gt;22&lt;/td&gt;
&lt;td&gt;54&lt;/td&gt;
&lt;td&gt;3.5&lt;/td&gt;
&lt;td&gt;5&lt;/td&gt;
&lt;td&gt;5&lt;/td&gt;
&lt;td&gt;52&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;4 micros&lt;/td&gt;
&lt;td&gt;108&lt;/td&gt;
&lt;td&gt;36&lt;/td&gt;
&lt;td&gt;72&lt;/td&gt;
&lt;td&gt;3.0&lt;/td&gt;
&lt;td&gt;4.5&lt;/td&gt;
&lt;td&gt;4&lt;/td&gt;
&lt;td&gt;80&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;5 micros&lt;/td&gt;
&lt;td&gt;137&lt;/td&gt;
&lt;td&gt;46&lt;/td&gt;
&lt;td&gt;91&lt;/td&gt;
&lt;td&gt;3.0&lt;/td&gt;
&lt;td&gt;3&lt;/td&gt;
&lt;td&gt;3&lt;/td&gt;
&lt;td&gt;127&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;One attempt of each size was still open when the bars ended. Sessions are medians: a session is a futures day from the 18:00 New York reopen. Attempts per target counts the finished attempts for each one that reached the target.&lt;/p&gt;

&lt;p&gt;The strategy made money to 23 February 2026 and lost it from 24 February 2026 at every size. In the first stretch 3 of 6 finished attempts reached the target at 1 micro and 31 of 79 at 5 micros. From 24 February 2026 none of the 7 at 1 micro reached it. At 5 micros 15 of 58 did while the strategy lost $41,900 at that size.&lt;/p&gt;

&lt;h2&gt;
  
  
  What each size did to the account
&lt;/h2&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;SIZE&lt;/th&gt;
&lt;th&gt;TRADES&lt;/th&gt;
&lt;th&gt;2 YEARS&lt;/th&gt;
&lt;th&gt;4 NOV 2024 → 23 FEB 2026&lt;/th&gt;
&lt;th&gt;24 FEB 2026 → 22 OCT 2026&lt;/th&gt;
&lt;th&gt;WORST DAY&lt;/th&gt;
&lt;th&gt;WORST DRAWDOWN&lt;/th&gt;
&lt;th&gt;TRADES THAT LOST OVER $1,000&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;1 micro&lt;/td&gt;
&lt;td&gt;500&lt;/td&gt;
&lt;td&gt;−$125&lt;/td&gt;
&lt;td&gt;+$8,255&lt;/td&gt;
&lt;td&gt;−$8,380&lt;/td&gt;
&lt;td&gt;−$749&lt;/td&gt;
&lt;td&gt;−$10,460&lt;/td&gt;
&lt;td&gt;0&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;2 micros&lt;/td&gt;
&lt;td&gt;500&lt;/td&gt;
&lt;td&gt;−$250&lt;/td&gt;
&lt;td&gt;+$16,510&lt;/td&gt;
&lt;td&gt;−$16,760&lt;/td&gt;
&lt;td&gt;−$1,498&lt;/td&gt;
&lt;td&gt;−$20,920&lt;/td&gt;
&lt;td&gt;11&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;3 micros&lt;/td&gt;
&lt;td&gt;500&lt;/td&gt;
&lt;td&gt;−$375&lt;/td&gt;
&lt;td&gt;+$24,765&lt;/td&gt;
&lt;td&gt;−$25,140&lt;/td&gt;
&lt;td&gt;−$2,247&lt;/td&gt;
&lt;td&gt;−$31,380&lt;/td&gt;
&lt;td&gt;53&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;4 micros&lt;/td&gt;
&lt;td&gt;500&lt;/td&gt;
&lt;td&gt;−$500&lt;/td&gt;
&lt;td&gt;+$33,020&lt;/td&gt;
&lt;td&gt;−$33,520&lt;/td&gt;
&lt;td&gt;−$2,996&lt;/td&gt;
&lt;td&gt;−$41,840&lt;/td&gt;
&lt;td&gt;99&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;5 micros&lt;/td&gt;
&lt;td&gt;500&lt;/td&gt;
&lt;td&gt;−$625&lt;/td&gt;
&lt;td&gt;+$41,275&lt;/td&gt;
&lt;td&gt;−$41,900&lt;/td&gt;
&lt;td&gt;−$3,745&lt;/td&gt;
&lt;td&gt;−$52,300&lt;/td&gt;
&lt;td&gt;145&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;The same 500 trades at every size: the size multiplies every dollar including the costs. One trade a day: the worst day is the worst trade. The worst drawdown is the deepest fall from a high between 4 November 2024 and 22 October 2026 with no attempt starting it again.&lt;/p&gt;

&lt;p&gt;At 1 micro no trade lost more than $1,000. At 3 micros 53 did and at 5 micros 145. At 1 micro the account's deepest fall over the two years was $10,460: more than 5 times the $2,000 drawdown.&lt;/p&gt;

&lt;h2&gt;
  
  
  The daily loss at bigger sizes
&lt;/h2&gt;

&lt;p&gt;At 1 micro no day reached the $1,000 daily loss. At 2 micros it stopped 12 days and at 5 micros 127. On 96 of those 127 days the trade was still on: the check cut it before its own exit. Of those 96 trades 26 would have ended as winners. On the other 31 the trade left during that bar.&lt;/p&gt;

&lt;p&gt;The check cuts every trade that was on where the day touched the limit and charges the exit's commission and a tick of slippage.&lt;/p&gt;

&lt;h2&gt;
  
  
  The script as it ran
&lt;/h2&gt;

&lt;h3&gt;
  
  
  MNQ opening range breakout with a micros input
&lt;/h3&gt;

&lt;p&gt;A 15-minute opening range from 9:30 New York. A close through it after a close inside it enters from 9:45 to 12:00. One trade a day. The stop sits at the range's other side and the target at 2R. Flat on the 15:55 New York bar or the session's last bar. The Contracts input sets the micros: 1 as published.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Trades: 500&lt;/li&gt;
&lt;li&gt;Won: 45.4%&lt;/li&gt;
&lt;li&gt;Profit factor: 1.00&lt;/li&gt;
&lt;li&gt;Net: −0.2%&lt;/li&gt;
&lt;li&gt;Worst drawdown: −17.6%&lt;/li&gt;
&lt;li&gt;Worst trade: −$749&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;MNQ1! · 5-minute · 4 Nov 2024 → 22 Oct 2026 · $2.50 a contract each side and a tick of slippage · 1 micro on a $50,000 account&lt;/p&gt;

&lt;p&gt;+$8,255 from 4 November 2024 to 23 February 2026, −$8,380 from 24 February 2026 to 22 October 2026 on 1 micro.&lt;/p&gt;

&lt;p&gt;Pine Script v6 · 64 lines&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;//@version=6
// Suggested timeframe: 5-minute
strategy("MNQ opening range breakout, flat before the session ends", overlay=true, initial_capital=50000, default_qty_type=strategy.fixed, default_qty_value=1,
     commission_type=strategy.commission.cash_per_contract, commission_value=2.5, slippage=1, margin_long=0, margin_short=0)

// ── Flat before the session ends ─────────────────────────────────────────────────────────────────
flatOn = input.bool(true, "Flat before the session ends", group="Session end")
flatAt = input.session("1555-1600", "Flat from (New York)", group="Session end")

// Name the clock: with no zone, hour() and minute() read the exchange's clock, Chicago on CME's NQ
// and ES, an hour behind New York. session.islastbar also catches a holiday's early close
flatNow = flatOn and (not na(time(timeframe.period, flatAt, "America/New_York")) or session.islastbar)

// From the flat time on: no order left waiting and every trade closed at the bar's close
if flatNow
    strategy.cancel_all()
    strategy.close_all("Flat", immediately=true)

// ── The example strategy: a 15-minute opening range breakout, one trade a day ──────────────────
// Your own entries go here, behind "not flatNow"
orSess    = input.session("0930-0945", "Opening range (New York)", group="Strategy")
tradeSess = input.session("0945-1200", "Entry window (New York)", group="Strategy")
rMult     = input.float(2.0, "Target (R)", minval=0.5, step=0.5, group="Strategy")
// The size: MNQ micros a trade. One micro is $2 a point: a stop's dollars grow with every micro
micros    = input.int(1, "Contracts (MNQ micros)", minval=1, group="Strategy")

inOR    = not na(time(timeframe.period, orSess, "America/New_York"))
inTrade = not na(time(timeframe.period, tradeSess, "America/New_York"))

var float orHigh      = na
var float orLow       = na
var int   tradesToday = 0
var float stopLevel   = na
var float targetLevel = na
if session.isfirstbar
    orHigh      := na
    orLow       := na
    tradesToday := 0
if inOR
    orHigh := na(orHigh) ? high : math.max(orHigh, high)
    orLow  := na(orLow) ? low : math.min(orLow, low)

// The setup: the first close through the range after a close inside it. The stop sits at the
// range's other side and the target at rMult times the risk
rangeSet   = not inOR and not na(orHigh)
longSetup  = rangeSet and close &amp;gt; orHigh and close[1] &amp;lt;= orHigh
shortSetup = rangeSet and close &amp;lt; orLow and close[1] &amp;gt;= orLow
canTrade   = inTrade and strategy.position_size == 0 and tradesToday &amp;lt; 1 and not flatNow

if canTrade and longSetup and orLow &amp;lt; close
    stopLevel   := orLow
    targetLevel := close + (close - orLow) * rMult
    strategy.entry("Long", strategy.long, qty=micros)
    strategy.exit("Long exit", from_entry="Long", stop=stopLevel, limit=targetLevel)
    tradesToday += 1
else if canTrade and shortSetup and orHigh &amp;gt; close
    stopLevel   := orHigh
    targetLevel := close - (orHigh - close) * rMult
    strategy.entry("Short", strategy.short, qty=micros)
    strategy.exit("Short exit", from_entry="Short", stop=stopLevel, limit=targetLevel)
    tradesToday += 1

plot(rangeSet ? orHigh : na, "Range high", color=color.new(#16A56A, 0), style=plot.style_linebr)
plot(rangeSet ? orLow : na, "Range low", color=color.new(#E5484D, 0), style=plot.style_linebr)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The rule that closes it before the session ends is on &lt;a href="https://getalphacharts.com/pine-script-close-before-session-end" rel="noopener noreferrer"&gt;our close before the session ends page&lt;/a&gt;. A firm's rules kept inside a script are on &lt;a href="https://getalphacharts.com/prop-firm-strategy-backtester" rel="noopener noreferrer"&gt;our prop firm page&lt;/a&gt;. MNQ against NQ for a 50K is on &lt;a href="https://getalphacharts.com/mnq-vs-nq" rel="noopener noreferrer"&gt;our MNQ or NQ page&lt;/a&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  Questions
&lt;/h2&gt;

&lt;h3&gt;
  
  
  How many micros can I trade on a 50K account?
&lt;/h3&gt;

&lt;p&gt;As many as your firm's plan allows: that is the most you may hold at once. On our test the worst day lost $749 at 1 micro and $3,745 at 5 micros against a $2,000 drawdown. You decide what size to trade.&lt;/p&gt;

&lt;h3&gt;
  
  
  Why did 5 micros reach the target more often than 1?
&lt;/h3&gt;

&lt;p&gt;Because a bigger size needs fewer winning days. At 5 micros an attempt that reached the target took 3 sessions at the median against 43 at 1 micro. Over 43 sessions the floor rises behind the closing balance. A fall back to it ends the attempt. The losing days grew too: 91 of the 137 finished attempts at 5 micros ended on the drawdown.&lt;/p&gt;

&lt;h3&gt;
  
  
  What does the daily loss do at bigger sizes?
&lt;/h3&gt;

&lt;p&gt;It stops the day once the account is down $1,000 at any point in it. At 1 micro that never happened in two years. At 5 micros it stopped 127 days. On 96 of them the trade was still on and was cut before its own exit. Of those 96 trades 26 would have ended as winners.&lt;/p&gt;

&lt;h3&gt;
  
  
  Does the size change what the strategy makes?
&lt;/h3&gt;

&lt;p&gt;Not per micro. Every size took the same 500 trades. The size multiplied every dollar including the costs: −$125 at 1 micro and −$625 at 5 micros over the two years. What changed was how far one day could move the account.&lt;/p&gt;

&lt;h3&gt;
  
  
  Can I run it myself?
&lt;/h3&gt;

&lt;p&gt;Yes. Run opens the script on MNQ 5-minute bars in the Alpha Charts terminal. On a computer, a free account with no card runs it as published on all two years. Its Contracts input sets the micros. A changed input or line makes it your own script: a free account then tests the newest 30 days of a futures chart under an hour. Prop Ready ($39 paid once) opens all two years for 30 days. The rules check in the terminal takes your own numbers for the target, the daily loss and the drawdown.&lt;/p&gt;

&lt;h3&gt;
  
  
  Is a backtest a prediction?
&lt;/h3&gt;

&lt;p&gt;No. It is what a strategy's rules would have done on past prices with costs charged. Live fills, news and your own execution differ. Read it as a test of the rules and not as a forecast.&lt;/p&gt;

&lt;p&gt;Every number comes from Alpha Charts' tester on MNQ 5-minute bars from 4 November 2024 to 22 October 2026. The runs were made on 27 November 2026. Alpha Charts is software for testing trading scripts and gives no investment advice. It is not a prop firm and is not connected with any. A backtest shows what rules would have done on past data. It does not show what they will do. Our methodology is in &lt;a href="https://getalphacharts.com/guide/data-and-methodology" rel="noopener noreferrer"&gt;Data and methodology&lt;/a&gt;. Updated 27 November 2026.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Originally published at &lt;a href="https://getalphacharts.com/how-many-micros-50k-account" rel="noopener noreferrer"&gt;getalphacharts.com&lt;/a&gt;.&lt;/em&gt;&lt;/p&gt;

</description>
      <category>pinescript</category>
      <category>tradingview</category>
      <category>trading</category>
      <category>futures</category>
    </item>
    <item>
      <title>Intraday trailing drawdown or end of day: which ends more attempts?</title>
      <dc:creator>Alpha Charts</dc:creator>
      <pubDate>Sat, 28 Nov 2026 22:26:40 +0000</pubDate>
      <link>https://dev.to/alphacharts/intraday-trailing-drawdown-or-end-of-day-which-ends-more-attempts-1en9</link>
      <guid>https://dev.to/alphacharts/intraday-trailing-drawdown-or-end-of-day-which-ends-more-attempts-1en9</guid>
      <description>&lt;p&gt;A floor that trails every new high ended more attempts than one that trails the day's close at every size we tested. At 5 micros it took 4.6 attempts for each one that reached the target against 3.0.&lt;/p&gt;

&lt;p&gt;We ran one MNQ opening range breakout at 1, 2, 3, 4 and 5 micros through the rules check twice on the same trades. The account was $50,000 with a $3,000 target, a $2,000 drawdown that stops rising at the start and a $1,000 daily loss. Once the floor trailed the day's closing balance: end of day (EOD). Once it trailed every new high with the open trade included: intraday.&lt;/p&gt;

&lt;p&gt;Under the end-of-day floor 46 of 137 finished attempts reached the target at 5 micros and 3 of 13 at 1 micro. Under every new high 42 of 193 did at 5 micros and 3 of 15 at 1 micro. More ended on the drawdown at every size: 12 against 10 at 1 micro and 151 against 91 at 5. Your firm's plan says which floor you have. You decide what size to trade.&lt;/p&gt;

&lt;p&gt;The difference is open profit. A trade that runs up and comes back lifts a floor that trails every new high to its peak. An end-of-day floor moves only on the closing balance. Once the floor reaches the starting balance both stop there and read the same.&lt;/p&gt;

&lt;h2&gt;
  
  
  Both floors in the rules check
&lt;/h2&gt;

&lt;p&gt;Each example evaluation starts at $50,000 on a futures day. It reaches the target at $3,000 up. It ends on the drawdown when the balance touches its floor at any point in a bar. The floor sits $2,000 under the high and stops rising at the start. A day down $1,000 is stopped and the attempt goes on the next day. The next attempt starts on the futures day after one ends. These are example numbers.&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;SIZE AND FLOOR&lt;/th&gt;
&lt;th&gt;ATTEMPTS FINISHED&lt;/th&gt;
&lt;th&gt;REACHED THE TARGET&lt;/th&gt;
&lt;th&gt;ENDED ON THE DRAWDOWN&lt;/th&gt;
&lt;th&gt;ATTEMPTS PER TARGET&lt;/th&gt;
&lt;th&gt;SESSIONS TO THE TARGET&lt;/th&gt;
&lt;th&gt;SESSIONS TO THE DRAWDOWN&lt;/th&gt;
&lt;th&gt;DAYS THE DAILY LOSS STOPPED&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;1 micro · the floor trails the day's close&lt;/td&gt;
&lt;td&gt;13&lt;/td&gt;
&lt;td&gt;3&lt;/td&gt;
&lt;td&gt;10&lt;/td&gt;
&lt;td&gt;4.3&lt;/td&gt;
&lt;td&gt;43&lt;/td&gt;
&lt;td&gt;34&lt;/td&gt;
&lt;td&gt;0&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;1 micro · the floor trails every new high&lt;/td&gt;
&lt;td&gt;15&lt;/td&gt;
&lt;td&gt;3&lt;/td&gt;
&lt;td&gt;12&lt;/td&gt;
&lt;td&gt;5.0&lt;/td&gt;
&lt;td&gt;46&lt;/td&gt;
&lt;td&gt;18.5&lt;/td&gt;
&lt;td&gt;0&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;2 micros · the floor trails the day's close&lt;/td&gt;
&lt;td&gt;45&lt;/td&gt;
&lt;td&gt;14&lt;/td&gt;
&lt;td&gt;31&lt;/td&gt;
&lt;td&gt;3.2&lt;/td&gt;
&lt;td&gt;7.5&lt;/td&gt;
&lt;td&gt;9&lt;/td&gt;
&lt;td&gt;12&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;2 micros · the floor trails every new high&lt;/td&gt;
&lt;td&gt;57&lt;/td&gt;
&lt;td&gt;15&lt;/td&gt;
&lt;td&gt;42&lt;/td&gt;
&lt;td&gt;3.8&lt;/td&gt;
&lt;td&gt;8&lt;/td&gt;
&lt;td&gt;6&lt;/td&gt;
&lt;td&gt;5&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;3 micros · the floor trails the day's close&lt;/td&gt;
&lt;td&gt;76&lt;/td&gt;
&lt;td&gt;22&lt;/td&gt;
&lt;td&gt;54&lt;/td&gt;
&lt;td&gt;3.5&lt;/td&gt;
&lt;td&gt;5&lt;/td&gt;
&lt;td&gt;5&lt;/td&gt;
&lt;td&gt;52&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;3 micros · the floor trails every new high&lt;/td&gt;
&lt;td&gt;106&lt;/td&gt;
&lt;td&gt;23&lt;/td&gt;
&lt;td&gt;83&lt;/td&gt;
&lt;td&gt;4.6&lt;/td&gt;
&lt;td&gt;5&lt;/td&gt;
&lt;td&gt;4&lt;/td&gt;
&lt;td&gt;38&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;4 micros · the floor trails the day's close&lt;/td&gt;
&lt;td&gt;108&lt;/td&gt;
&lt;td&gt;36&lt;/td&gt;
&lt;td&gt;72&lt;/td&gt;
&lt;td&gt;3.0&lt;/td&gt;
&lt;td&gt;4.5&lt;/td&gt;
&lt;td&gt;4&lt;/td&gt;
&lt;td&gt;80&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;4 micros · the floor trails every new high&lt;/td&gt;
&lt;td&gt;148&lt;/td&gt;
&lt;td&gt;30&lt;/td&gt;
&lt;td&gt;118&lt;/td&gt;
&lt;td&gt;4.9&lt;/td&gt;
&lt;td&gt;4&lt;/td&gt;
&lt;td&gt;3&lt;/td&gt;
&lt;td&gt;73&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;5 micros · the floor trails the day's close&lt;/td&gt;
&lt;td&gt;137&lt;/td&gt;
&lt;td&gt;46&lt;/td&gt;
&lt;td&gt;91&lt;/td&gt;
&lt;td&gt;3.0&lt;/td&gt;
&lt;td&gt;3&lt;/td&gt;
&lt;td&gt;3&lt;/td&gt;
&lt;td&gt;127&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;5 micros · the floor trails every new high&lt;/td&gt;
&lt;td&gt;193&lt;/td&gt;
&lt;td&gt;42&lt;/td&gt;
&lt;td&gt;151&lt;/td&gt;
&lt;td&gt;4.6&lt;/td&gt;
&lt;td&gt;2&lt;/td&gt;
&lt;td&gt;2&lt;/td&gt;
&lt;td&gt;100&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;One attempt of each size and floor was still open when the bars ended. Sessions are medians: a session is a futures day from the 18:00 New York reopen. Attempts per target counts the finished attempts for each one that reached the target.&lt;/p&gt;

&lt;p&gt;The gap grew with the size: 2 more attempts ended on the drawdown at 1 micro, 11 at 2, 29 at 3, 46 at 4 and 60 at 5. Every micro multiplies the open profit a trade gives back before its exit.&lt;/p&gt;

&lt;p&gt;At 2 and 3 micros one more attempt reached the target under every new high: 15 against 14 and 23 against 22. The attempts that ended on the drawdown ended sooner: at the median 6 sessions against 9 at 2 micros. More attempts fit in the same two years: 57 finished against 45. It took more of them for each one that reached the target: 3.8 against 3.2.&lt;/p&gt;

&lt;h2&gt;
  
  
  Where the two floors parted
&lt;/h2&gt;

&lt;p&gt;The fourth attempt at 1 micro started on the futures day of 26 May 2025 under both floors and took the same trades.&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;DAY&lt;/th&gt;
&lt;th&gt;WHAT HAPPENED&lt;/th&gt;
&lt;th&gt;END-OF-DAY FLOOR&lt;/th&gt;
&lt;th&gt;EVERY-NEW-HIGH FLOOR&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;26 May 2025&lt;/td&gt;
&lt;td&gt;The attempt starts at $50,000&lt;/td&gt;
&lt;td&gt;$48,000&lt;/td&gt;
&lt;td&gt;$48,000&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;29 May 2025&lt;/td&gt;
&lt;td&gt;A short's open profit peaks at $377.50: the attempt is $856.50 up. It closes at 15:55 for +$154 and the day ends $633 up.&lt;/td&gt;
&lt;td&gt;$48,633 from the day's close&lt;/td&gt;
&lt;td&gt;$48,856.50 from the trade's peak&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;18 Jun 2025 at 13:30 New York&lt;/td&gt;
&lt;td&gt;The attempt falls to $48,809 at a bar's worst point with a long on&lt;/td&gt;
&lt;td&gt;$48,633: the attempt goes on&lt;/td&gt;
&lt;td&gt;Touched: the attempt ends after 18 sessions&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;24 Jul 2025&lt;/td&gt;
&lt;td&gt;The attempt touches the end-of-day floor&lt;/td&gt;
&lt;td&gt;Touched: the attempt ends after 44 sessions&lt;/td&gt;
&lt;td&gt;—&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;The attempt never went higher than $856.50 up. From 30 May to 18 June the two floors sat $223.50 apart: the open profit the short gave back between its peak and its exit.&lt;/p&gt;

&lt;h2&gt;
  
  
  The script as it ran
&lt;/h2&gt;

&lt;h3&gt;
  
  
  MNQ opening range breakout with a micros input
&lt;/h3&gt;

&lt;p&gt;A 15-minute opening range from 9:30 New York. A close through it after a close inside it enters from 9:45 to 12:00. One trade a day. The stop sits at the range's other side and the target at 2R. Flat on the 15:55 New York bar or the session's last bar. The Contracts input sets the micros: 1 as published.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Trades: 500&lt;/li&gt;
&lt;li&gt;Won: 45.4%&lt;/li&gt;
&lt;li&gt;Profit factor: 1.00&lt;/li&gt;
&lt;li&gt;Net: −0.2%&lt;/li&gt;
&lt;li&gt;Worst drawdown: −17.6%&lt;/li&gt;
&lt;li&gt;Worst trade: −$749&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;MNQ1! · 5-minute · 4 Nov 2024 → 22 Oct 2026 · $2.50 a contract each side and a tick of slippage · 1 micro on a $50,000 account&lt;/p&gt;

&lt;p&gt;+$8,255 from 4 November 2024 to 23 February 2026, −$8,380 from 24 February 2026 to 22 October 2026 on 1 micro.&lt;/p&gt;

&lt;p&gt;Pine Script v6 · 64 lines&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;//@version=6
// Suggested timeframe: 5-minute
strategy("MNQ opening range breakout, flat before the session ends", overlay=true, initial_capital=50000, default_qty_type=strategy.fixed, default_qty_value=1,
     commission_type=strategy.commission.cash_per_contract, commission_value=2.5, slippage=1, margin_long=0, margin_short=0)

// ── Flat before the session ends ─────────────────────────────────────────────────────────────────
flatOn = input.bool(true, "Flat before the session ends", group="Session end")
flatAt = input.session("1555-1600", "Flat from (New York)", group="Session end")

// Name the clock: with no zone, hour() and minute() read the exchange's clock, Chicago on CME's NQ
// and ES, an hour behind New York. session.islastbar also catches a holiday's early close
flatNow = flatOn and (not na(time(timeframe.period, flatAt, "America/New_York")) or session.islastbar)

// From the flat time on: no order left waiting and every trade closed at the bar's close
if flatNow
    strategy.cancel_all()
    strategy.close_all("Flat", immediately=true)

// ── The example strategy: a 15-minute opening range breakout, one trade a day ──────────────────
// Your own entries go here, behind "not flatNow"
orSess    = input.session("0930-0945", "Opening range (New York)", group="Strategy")
tradeSess = input.session("0945-1200", "Entry window (New York)", group="Strategy")
rMult     = input.float(2.0, "Target (R)", minval=0.5, step=0.5, group="Strategy")
// The size: MNQ micros a trade. One micro is $2 a point: a stop's dollars grow with every micro
micros    = input.int(1, "Contracts (MNQ micros)", minval=1, group="Strategy")

inOR    = not na(time(timeframe.period, orSess, "America/New_York"))
inTrade = not na(time(timeframe.period, tradeSess, "America/New_York"))

var float orHigh      = na
var float orLow       = na
var int   tradesToday = 0
var float stopLevel   = na
var float targetLevel = na
if session.isfirstbar
    orHigh      := na
    orLow       := na
    tradesToday := 0
if inOR
    orHigh := na(orHigh) ? high : math.max(orHigh, high)
    orLow  := na(orLow) ? low : math.min(orLow, low)

// The setup: the first close through the range after a close inside it. The stop sits at the
// range's other side and the target at rMult times the risk
rangeSet   = not inOR and not na(orHigh)
longSetup  = rangeSet and close &amp;gt; orHigh and close[1] &amp;lt;= orHigh
shortSetup = rangeSet and close &amp;lt; orLow and close[1] &amp;gt;= orLow
canTrade   = inTrade and strategy.position_size == 0 and tradesToday &amp;lt; 1 and not flatNow

if canTrade and longSetup and orLow &amp;lt; close
    stopLevel   := orLow
    targetLevel := close + (close - orLow) * rMult
    strategy.entry("Long", strategy.long, qty=micros)
    strategy.exit("Long exit", from_entry="Long", stop=stopLevel, limit=targetLevel)
    tradesToday += 1
else if canTrade and shortSetup and orHigh &amp;gt; close
    stopLevel   := orHigh
    targetLevel := close - (orHigh - close) * rMult
    strategy.entry("Short", strategy.short, qty=micros)
    strategy.exit("Short exit", from_entry="Short", stop=stopLevel, limit=targetLevel)
    tradesToday += 1

plot(rangeSet ? orHigh : na, "Range high", color=color.new(#16A56A, 0), style=plot.style_linebr)
plot(rangeSet ? orLow : na, "Range low", color=color.new(#E5484D, 0), style=plot.style_linebr)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Pine Script code for either floor is on &lt;a href="https://getalphacharts.com/pine-script-trailing-drawdown" rel="noopener noreferrer"&gt;our trailing drawdown in Pine Script page&lt;/a&gt;. The five sizes side by side are on &lt;a href="https://getalphacharts.com/how-many-micros-50k-account" rel="noopener noreferrer"&gt;our how many micros page&lt;/a&gt;. A consistency rule is on &lt;a href="https://getalphacharts.com/consistency-rule-calculator" rel="noopener noreferrer"&gt;our consistency rule calculator&lt;/a&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  Questions
&lt;/h2&gt;

&lt;h3&gt;
  
  
  What is the difference between a trailing drawdown and an end-of-day drawdown?
&lt;/h3&gt;

&lt;p&gt;Both keep the account's floor a fixed amount under its high. An end-of-day drawdown moves the floor once a day from the closing balance. An intraday trailing drawdown moves it at every new high during the day with open profit included. A trade that runs up and comes back raises the intraday floor and leaves the end-of-day floor where it was.&lt;/p&gt;

&lt;h3&gt;
  
  
  Is an intraday trailing drawdown harder than end of day?
&lt;/h3&gt;

&lt;p&gt;On our test it ended more attempts at every size: 12 against 10 at 1 micro and 151 against 91 at 5 micros. At 5 micros it took 4.6 attempts for each one that reached the target against 3.0. Another strategy can differ: the rules check runs any strategy under both.&lt;/p&gt;

&lt;h3&gt;
  
  
  Why did more attempts reach the target at 2 and 3 micros under every new high?
&lt;/h3&gt;

&lt;p&gt;Because more attempts started. Under every new high the attempts that ended on the drawdown ended sooner. More of them fit in the same two years: 57 finished against 45 at 2 micros. It took more attempts for each one that reached the target: 3.8 against 3.2.&lt;/p&gt;

&lt;h3&gt;
  
  
  Does the trailing type matter once the floor reaches the starting balance?
&lt;/h3&gt;

&lt;p&gt;Not in these rules. The floor stops rising at $50,000 under both. From there it stays at the start and the two read the same. Plans differ on where the floor stops.&lt;/p&gt;

&lt;h3&gt;
  
  
  Can I check my own strategy under both?
&lt;/h3&gt;

&lt;p&gt;Yes. The rules check in the Alpha Charts terminal has a switch for how the floor trails: the day's close, every new high or nothing. Run opens the script on this page on MNQ 5-minute bars. On a computer, a free account with no card runs it as published on all two years. A changed input or line makes it your own script: a free account then tests the newest 30 days of a futures chart under an hour. Prop Ready ($39 paid once) opens all two years for 30 days.&lt;/p&gt;

&lt;h3&gt;
  
  
  Is a backtest a prediction?
&lt;/h3&gt;

&lt;p&gt;No. It is what a strategy's rules would have done on past prices with costs charged. Live fills, news and your own execution differ. Read it as a test of the rules and not as a forecast.&lt;/p&gt;

&lt;p&gt;Every number comes from Alpha Charts' tester and its rules check on MNQ 5-minute bars from 4 November 2024 to 22 October 2026. The runs were made on 28 November 2026. Alpha Charts is software for testing trading scripts and gives no investment advice. It is not a prop firm and is not connected with any. A backtest shows what rules would have done on past data. It does not show what they will do. Our methodology is in &lt;a href="https://getalphacharts.com/guide/data-and-methodology" rel="noopener noreferrer"&gt;Data and methodology&lt;/a&gt;. Updated 28 November 2026.&lt;/p&gt;

</description>
      <category>pinescript</category>
      <category>tradingview</category>
      <category>trading</category>
      <category>futures</category>
    </item>
    <item>
      <title>How do I code a consistency rule in Pine Script?</title>
      <dc:creator>Alpha Charts</dc:creator>
      <pubDate>Sat, 28 Nov 2026 21:46:40 +0000</pubDate>
      <link>https://dev.to/alphacharts/how-do-i-code-a-consistency-rule-in-pine-script-21ka</link>
      <guid>https://dev.to/alphacharts/how-do-i-code-a-consistency-rule-in-pine-script-21ka</guid>
      <description>&lt;p&gt;Keep the day's books and the biggest day. Then stop each day at the rule's share of your profit target.&lt;/p&gt;

&lt;p&gt;With no day above 30% of the profit and a $3,000 target the cap is $900. A day that stops there can never be more than 30% of a profit that reached the target. The script below does it.&lt;/p&gt;

&lt;p&gt;We checked it on back-to-back example evaluations over two years of MNQ. Without the cap 49 of 146 evaluations reached the target and 1 met the rule. With the cap 37 of 98 reached it and 33 met the rule. The other 4 each had a day above $900: the trade went past the cap on its first candle before the limit had the fill's price.&lt;/p&gt;

&lt;h2&gt;
  
  
  The code in three parts
&lt;/h2&gt;

&lt;h3&gt;
  
  
  1. The books
&lt;/h3&gt;

&lt;p&gt;Add up &lt;code&gt;strategy.closedtrades.profit&lt;/code&gt; after costs for the day's profit, the profit so far and the biggest day. The day starts at the futures day's first bar: the 18:00 New York reopen. The books count from &lt;code&gt;csFrom&lt;/code&gt;: set it to your evaluation's start.&lt;/p&gt;

&lt;h3&gt;
  
  
  2. The check
&lt;/h3&gt;

&lt;p&gt;The biggest day's share of the profit so far is &lt;code&gt;csTop / csTotal&lt;/code&gt;. The rule is met while it is at or under the share.&lt;/p&gt;

&lt;h3&gt;
  
  
  3. The cap
&lt;/h3&gt;

&lt;p&gt;Each day stops at the share of the target. Its price goes in the trade's limit from the candle after the fill and the day takes no new entry once it is reached. Put &lt;code&gt;not csHit&lt;/code&gt; in front of each entry's condition.&lt;/p&gt;

&lt;p&gt;The rule on its own · 38 lines&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;// ── The consistency rule ─────────────────────────────────────────────────────────────────────────
// Example numbers, not any firm's: take yours from your plan's own page
csTarget = input.float(3000, "Profit target ($)", minval=1, group="Consistency rule")
csShare  = input.float(30, "Most of the profit one day may make (%)", minval=1, maxval=100, group="Consistency rule")
csCapOn  = input.bool(true, "Stop each day at that share of the target", group="Consistency rule")
csFee    = input.float(2.5, "Commission per contract each side ($)", minval=0, group="Consistency rule")
csFrom   = input.time(timestamp("2000-01-01"), "Count from your evaluation's start", group="Consistency rule")

// The books, from the closed trades after their costs: the day's profit, the profit so far and the
// biggest day so far. They count only the trades that close from csFrom on: set it to your
// evaluation's start. A futures day starts at its first bar, the 18:00 New York reopen
var float csDay   = 0.0
var float csTotal = 0.0
var float csTop   = 0.0
var int   csSeen  = 0
var bool  csHit   = false
while csSeen &amp;lt; strategy.closedtrades
    if strategy.closedtrades.exit_time(csSeen) &amp;gt;= csFrom
        csDay   += strategy.closedtrades.profit(csSeen)
        csTotal += strategy.closedtrades.profit(csSeen)
    csSeen += 1
csTop := math.max(csTop, csDay)
if session.isfirstbar
    csDay := 0.0
    csHit := false

// The check: the biggest day's share of the profit so far
csTopShare = csTotal &amp;gt; 0 ? csTop / csTotal * 100 : na

// The cap: a day that stops at the share of the target can never be more than that share of a
// profit that reached the target. Its price goes in the trade's limit, as for a daily profit target
csCap = csShare / 100 * csTarget
csPriceLong(entry, size) =&amp;gt;
    entry + (csCap - csDay + 2 * csFee * size) / (size * syminfo.pointvalue)
csPriceShort(entry, size) =&amp;gt;
    entry - (csCap - csDay + 2 * csFee * size) / (size * syminfo.pointvalue)
if csCapOn and not csHit and csDay &amp;gt;= csCap - 0.005
    csHit := true
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Paste it under your strategy() line. Put &lt;code&gt;not csHit&lt;/code&gt; in front of each entry's condition and &lt;code&gt;csPriceLong&lt;/code&gt; or &lt;code&gt;csPriceShort&lt;/code&gt; in each exit's limit from the candle after the fill. The full script below does both.&lt;/p&gt;

&lt;h2&gt;
  
  
  The rules check
&lt;/h2&gt;

&lt;p&gt;Each example evaluation starts at $0 on a futures day and ends when its closed profit reaches $3,000 or falls to its floor. The floor sits $2,000 under the highest closing balance of its days and stops rising at the start. The next one starts on the next day. On reaching the target the rule is met when no day made more than 30% of the profit. These are example numbers and no firm's.&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;RUN&lt;/th&gt;
&lt;th&gt;EVALUATIONS&lt;/th&gt;
&lt;th&gt;REACHED THE TARGET&lt;/th&gt;
&lt;th&gt;MET THE RULE&lt;/th&gt;
&lt;th&gt;A DAY ABOVE 30%&lt;/th&gt;
&lt;th&gt;FAILED&lt;/th&gt;
&lt;th&gt;MEDIAN DAYS TO THE TARGET&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;No cap&lt;/td&gt;
&lt;td&gt;146&lt;/td&gt;
&lt;td&gt;49&lt;/td&gt;
&lt;td&gt;1&lt;/td&gt;
&lt;td&gt;48&lt;/td&gt;
&lt;td&gt;96&lt;/td&gt;
&lt;td&gt;4&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;$900 cap in the trade's limit&lt;/td&gt;
&lt;td&gt;98&lt;/td&gt;
&lt;td&gt;37&lt;/td&gt;
&lt;td&gt;33&lt;/td&gt;
&lt;td&gt;4&lt;/td&gt;
&lt;td&gt;60&lt;/td&gt;
&lt;td&gt;7&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;One evaluation of each run was still open when the bars ended. Trades count when they close.&lt;/p&gt;

&lt;p&gt;Without the cap the biggest day made 61.1% of the profit at the median when the target was reached. 7 evaluations reached it in a single day. With the cap the median was 25% and none reached it in one day.&lt;/p&gt;

&lt;h2&gt;
  
  
  The two runs
&lt;/h2&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;RUN&lt;/th&gt;
&lt;th&gt;TRADES&lt;/th&gt;
&lt;th&gt;WON&lt;/th&gt;
&lt;th&gt;DAYS CAPPED&lt;/th&gt;
&lt;th&gt;2 YEARS&lt;/th&gt;
&lt;th&gt;4 NOV 2024 → 23 FEB 2026&lt;/th&gt;
&lt;th&gt;24 FEB 2026 → 22 OCT 2026&lt;/th&gt;
&lt;th&gt;WORST DRAWDOWN&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;No cap&lt;/td&gt;
&lt;td&gt;634&lt;/td&gt;
&lt;td&gt;45.7%&lt;/td&gt;
&lt;td&gt;0&lt;/td&gt;
&lt;td&gt;+$38,615&lt;/td&gt;
&lt;td&gt;+$52,995&lt;/td&gt;
&lt;td&gt;−$14,380&lt;/td&gt;
&lt;td&gt;−$39,845&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;$900 cap in the trade's limit&lt;/td&gt;
&lt;td&gt;621&lt;/td&gt;
&lt;td&gt;56.4%&lt;/td&gt;
&lt;td&gt;278&lt;/td&gt;
&lt;td&gt;+$40,110&lt;/td&gt;
&lt;td&gt;+$38,270&lt;/td&gt;
&lt;td&gt;+$1,840&lt;/td&gt;
&lt;td&gt;−$17,312.50&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;5 MNQ contracts on a $50,000 account pay $2.50 a contract each side and a tick of slippage. The runs and the check were fixed before they ran. The worst drawdown is the deepest fall from a high between 4 November 2024 and 22 October 2026.&lt;/p&gt;

&lt;p&gt;The cap did not cost this breakout. It made $40,110 over two years against $38,615 without it and its worst drawdown was $17,312.50 against $39,845. It made money in both periods: $38,270 to 23 February 2026 and $1,840 from 24 February 2026. Without the cap the strategy lost $14,380 from 24 February 2026.&lt;/p&gt;

&lt;h2&gt;
  
  
  The script as it ran
&lt;/h2&gt;

&lt;h3&gt;
  
  
  MNQ opening range breakout with a 30% consistency cap
&lt;/h3&gt;

&lt;p&gt;A 15-minute opening range from 9:30 New York. A close through it after a close inside it enters from 9:45 to 12:00. The day takes up to 3 trades. The stop sits at the range's other side and the target at 2R. Each day stops at 30% of a $3,000 profit target: the cap's price is in each trade's limit from the candle after its fill. 5 MNQ contracts. The Data Window shows the biggest day and its share of the profit.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Trades: 621&lt;/li&gt;
&lt;li&gt;Won: 56.4%&lt;/li&gt;
&lt;li&gt;Profit factor: 1.14&lt;/li&gt;
&lt;li&gt;Net: +80.2%&lt;/li&gt;
&lt;li&gt;Worst drawdown: −21.7%&lt;/li&gt;
&lt;li&gt;Worst trade: −$2,912.50&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;MNQ1! · 5-minute · 4 Nov 2024 → 22 Oct 2026 · $2.50 a contract each side and a tick of slippage · 5 contracts on a $50,000 account&lt;/p&gt;

&lt;p&gt;+$38,270 from 4 November 2024 to 23 February 2026, +$1,840 from 24 February 2026 to 22 October 2026.&lt;/p&gt;

&lt;p&gt;Pine Script v6 · 103 lines&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;//@version=6
// Suggested timeframe: 5-minute
strategy("MNQ opening range breakout with a consistency cap", overlay=true, initial_capital=50000, default_qty_type=strategy.fixed, default_qty_value=5,
     commission_type=strategy.commission.cash_per_contract, commission_value=2.5, slippage=1, margin_long=0, margin_short=0)

// ── The consistency rule ─────────────────────────────────────────────────────────────────────────
// Example numbers, not any firm's: take yours from your plan's own page
csTarget = input.float(3000, "Profit target ($)", minval=1, group="Consistency rule")
csShare  = input.float(30, "Most of the profit one day may make (%)", minval=1, maxval=100, group="Consistency rule")
csCapOn  = input.bool(true, "Stop each day at that share of the target", group="Consistency rule")
csFee    = input.float(2.5, "Commission per contract each side ($)", minval=0, group="Consistency rule")
csFrom   = input.time(timestamp("2000-01-01"), "Count from your evaluation's start", group="Consistency rule")

// The books, from the closed trades after their costs: the day's profit, the profit so far and the
// biggest day so far. They count only the trades that close from csFrom on: set it to your
// evaluation's start. A futures day starts at its first bar, the 18:00 New York reopen
var float csDay   = 0.0
var float csTotal = 0.0
var float csTop   = 0.0
var int   csSeen  = 0
var bool  csHit   = false
while csSeen &amp;lt; strategy.closedtrades
    if strategy.closedtrades.exit_time(csSeen) &amp;gt;= csFrom
        csDay   += strategy.closedtrades.profit(csSeen)
        csTotal += strategy.closedtrades.profit(csSeen)
    csSeen += 1
csTop := math.max(csTop, csDay)
if session.isfirstbar
    csDay := 0.0
    csHit := false

// The check: the biggest day's share of the profit so far
csTopShare = csTotal &amp;gt; 0 ? csTop / csTotal * 100 : na

// The cap: a day that stops at the share of the target can never be more than that share of a
// profit that reached the target. Its price goes in the trade's limit, as for a daily profit target
csCap = csShare / 100 * csTarget
csPriceLong(entry, size) =&amp;gt;
    entry + (csCap - csDay + 2 * csFee * size) / (size * syminfo.pointvalue)
csPriceShort(entry, size) =&amp;gt;
    entry - (csCap - csDay + 2 * csFee * size) / (size * syminfo.pointvalue)
if csCapOn and not csHit and csDay &amp;gt;= csCap - 0.005
    csHit := true

// ── The example strategy: a 15-minute opening range breakout, up to three trades a day ──────────
// Your own entries go here, behind "not csHit", with the cap's price in the exit
orSess    = input.session("0930-0945", "Opening range (New York)", group="Strategy")
tradeSess = input.session("0945-1200", "Entry window (New York)", group="Strategy")
rMult     = input.float(2.0, "Target (R)", minval=0.5, step=0.5, group="Strategy")
maxDay    = input.int(3, "Trades per day", minval=1, group="Strategy")
qty       = input.int(5, "Contracts", minval=1, group="Strategy")

inOR    = not na(time(timeframe.period, orSess, "America/New_York"))
inTrade = not na(time(timeframe.period, tradeSess, "America/New_York"))

var float orHigh      = na
var float orLow       = na
var int   tradesToday = 0
var float stopLevel   = na
var float targetLevel = na
if session.isfirstbar
    orHigh      := na
    orLow       := na
    tradesToday := 0
if inOR
    orHigh := na(orHigh) ? high : math.max(orHigh, high)
    orLow  := na(orLow) ? low : math.min(orLow, low)

// The setup: a close through the range after a close inside it. The stop sits at the range's
// other side and the target at rMult times the risk. A new trade waits until the last one closed
rangeSet   = not inOR and not na(orHigh)
longSetup  = rangeSet and close &amp;gt; orHigh and close[1] &amp;lt;= orHigh
shortSetup = rangeSet and close &amp;lt; orLow and close[1] &amp;gt;= orLow
canTrade   = inTrade and strategy.position_size == 0 and tradesToday &amp;lt; maxDay and not csHit and not session.islastbar

if canTrade and longSetup and orLow &amp;lt; close
    stopLevel   := orLow
    targetLevel := close + (close - orLow) * rMult
    strategy.entry("Long", strategy.long, qty=qty)
    strategy.exit("Long exit", from_entry="Long", stop=stopLevel, limit=targetLevel)
    tradesToday += 1
if canTrade and shortSetup and orHigh &amp;gt; close
    stopLevel   := orHigh
    targetLevel := close - (orHigh - close) * rMult
    strategy.entry("Short", strategy.short, qty=qty)
    strategy.exit("Short exit", from_entry="Short", stop=stopLevel, limit=targetLevel)
    tradesToday += 1

// From the candle after the fill: the same stop, and the nearer of the target and the cap's price,
// worked out from the fill's own price. The entry is a market order, so its price is known only at the
// fill candle's close: a trade that goes past the cap on that first candle closes at the next open
if strategy.position_size &amp;gt; 0
    strategy.exit("Long exit", from_entry="Long", stop=stopLevel, limit=csCapOn ? math.min(targetLevel, csPriceLong(strategy.position_avg_price, strategy.position_size)) : targetLevel)
if strategy.position_size &amp;lt; 0
    strategy.exit("Short exit", from_entry="Short", stop=stopLevel, limit=csCapOn ? math.max(targetLevel, csPriceShort(strategy.position_avg_price, -strategy.position_size)) : targetLevel)
if session.islastbar
    strategy.close_all("Session end", immediately=true)

// The check, in the Data Window
plot(csTop, "Biggest day ($)", display=display.data_window)
plot(csTopShare, "Biggest day's share of the profit (%)", display=display.data_window)
plot(rangeSet ? orHigh : na, "Range high", color=color.new(#16A56A, 0), style=plot.style_linebr)
plot(rangeSet ? orLow : na, "Range low", color=color.new(#E5484D, 0), style=plot.style_linebr)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The cap works like a daily profit target: see &lt;a href="https://getalphacharts.com/pine-script-daily-profit-target" rel="noopener noreferrer"&gt;our daily profit target page&lt;/a&gt;. A firm's other rules kept in a script are on &lt;a href="https://getalphacharts.com/prop-firm-strategy-backtester" rel="noopener noreferrer"&gt;our prop firm page&lt;/a&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  Questions
&lt;/h2&gt;

&lt;h3&gt;
  
  
  How do I code a consistency rule in Pine Script?
&lt;/h3&gt;

&lt;p&gt;Keep the books from strategy.closedtrades.profit after costs: the day's profit, the profit so far and the biggest day. The rule is met while the biggest day is at or under its share of the profit. To keep it, stop each day at that share of your profit target: with no day above 30% of the profit and a $3,000 target that is $900. Put the cap's price in the trade's limit and take no new entry once the day reaches it. The script on this page does both in a block that goes on top of your own strategy.&lt;/p&gt;

&lt;h3&gt;
  
  
  How do I check my biggest day's share of the profit?
&lt;/h3&gt;

&lt;p&gt;Add each closed trade's profit to the day and to the total. Keep the biggest day. The share is the biggest day over the total. The script plots both in the Data Window so you can read them on any bar.&lt;/p&gt;

&lt;h3&gt;
  
  
  Does it count from my evaluation's first day?
&lt;/h3&gt;

&lt;p&gt;Yes, once its Count from input holds your evaluation's start: the 18:00 New York reopen before its first day. The books then count only the trades that close from that time on. Its default sits before any data: left alone it counts the chart's whole history.&lt;/p&gt;

&lt;h3&gt;
  
  
  Why cap the day at a share of the target?
&lt;/h3&gt;

&lt;p&gt;Because a day capped at 30% of a $3,000 target can never be more than 30% of a profit that reached $3,000. In our rules check 33 of the 37 capped evaluations that reached the target met the rule. Without the cap 1 of 49 did.&lt;/p&gt;

&lt;h3&gt;
  
  
  Does the cap always keep the rule?
&lt;/h3&gt;

&lt;p&gt;Not when the trade goes past the cap on its first candle. The limit takes the fill's price only at that candle's close and then fills at the next open past the cap. That happened on 4 capped days in our test. The 4 capped evaluations that broke the rule each had a day above $900.&lt;/p&gt;

&lt;h3&gt;
  
  
  Does a consistency cap cost profit?
&lt;/h3&gt;

&lt;p&gt;It did not on this breakout. Over two years it made $40,110 with the cap and $38,615 without it. Its worst drawdown was $17,312.50 against $39,845. A capped evaluation took longer to reach the target: 7 days at the median against 4.&lt;/p&gt;

&lt;h3&gt;
  
  
  Can I run it myself?
&lt;/h3&gt;

&lt;p&gt;Yes. Run opens the script on MNQ 5-minute bars in the Alpha Charts terminal. On a computer, a free account with no card runs it as published on all two years. Its inputs set the target, the share, the cap and where the count starts. A changed input or line makes it your own script: a free account then tests the newest 30 days of a chart under an hour. Prop Ready ($39 paid once) opens all two years for 30 days.&lt;/p&gt;

&lt;h3&gt;
  
  
  Is a backtest a prediction?
&lt;/h3&gt;

&lt;p&gt;No. It is what a strategy's rules would have done on past prices with costs charged. Live fills, news and your own execution differ. Read it as a test of the rules and not as a forecast.&lt;/p&gt;

&lt;p&gt;Every number comes from Alpha Charts' tester on MNQ 5-minute bars from 4 November 2024 to 22 October 2026. The runs were made on 27 November 2026. Alpha Charts is software for testing trading scripts and gives no investment advice. It is not a prop firm and is not connected with any. A backtest shows what rules would have done on past data. It does not show what they will do. Our methodology is in &lt;a href="https://getalphacharts.com/guide/data-and-methodology" rel="noopener noreferrer"&gt;Data and methodology&lt;/a&gt;. Updated 27 November 2026.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Originally published at &lt;a href="https://getalphacharts.com/pine-script-consistency-rule" rel="noopener noreferrer"&gt;getalphacharts.com&lt;/a&gt;.&lt;/em&gt;&lt;/p&gt;

</description>
      <category>pinescript</category>
      <category>tradingview</category>
      <category>trading</category>
      <category>fintech</category>
    </item>
  </channel>
</rss>
