NexusFi: Find Your Edge


Home Menu

 





[Release] SuperFlattenSafetyNet


Discussion in NinjaTrader

Updated
    1. trending_up 413 views
    2. thumb_up 9 thanks given
    3. group 1 followers
    1. forum 3 posts
    2. attach_file 0 attachments




 
Search this Thread
  #1 (permalink)
 
trendisyourfriend's Avatar
 trendisyourfriend 
Quebec Canada
Legendary Market Wizard
 
Experience: Intermediate
Platform: NinjaTrader
Broker: AMP/CQG
Trading: ES, NQ, YM
Frequency: Daily
Duration: Minutes
Posts: 4,580 since Oct 2009
Thanks Given: 4,266
Thanks Received: 6,199

[Release] SuperFlattenSafetyNet ::: Protection Against Rejected OCO/Bracket Orders
Introduction
We have all experienced the "nightmare scenario" during high-volatility events (FOMC, CPI, etc.): you enter a trade, but your Stop Loss or Profit Target is rejected by the broker because the price moved too fast or "gapped" your trigger. You are left with a "naked" position that NinjaTrader might not even realize is still open—the dreaded Ghost Position.

I am sharing the raw code of SuperFlattenSafetyNet strategy. This is not a trading strategy as such but must be compiled as a strategy to be used; it is a background risk-management utility designed to act as a fail-safe. It bridges the gap between Managed strategies and Manual (Chart Trader) trades by monitoring the Account level directly.


===

I have posted the instructions in markdown format along with the source code (use link):
https://pastecode.io/s/6npw125p

Just copy the whole script in the code section following the explanations


Started this thread Reply With Quote
Thanked by:

Can you help answer these questions
from other members on NexusFi?
Friday Update: Markets Now Pricing Fed Rate HIKES as Sta …
Traders Hideout
Prediction Markets Expiry Day: Trump Eyes War Exit, $230 …
Prediction Markets & Event Contracts
Irans Answer Due Today: Peace Surges to 33.5%, Invasion …
Prediction Markets & Event Contracts
Kalshi Rockets to $22B, Passes Polymarket in Volume -- B …
Prediction Markets & Event Contracts
Q1 2026 Shatters All Derivatives Volume Records -- CME H …
Traders Hideout
 
Best Threads (Most Thanked)
in the last 7 days on NexusFi
Sober Journey With S&P
22 thanks
2026 Jlab journal
10 thanks
Trying to learn Volume and price action correlation
8 thanks
Algo automated / semi-automated trading anyone?
6 thanks
Lady Vols Primer: Trading Volatility Journal
5 thanks
  #2 (permalink)
 
xplorer's Avatar
 xplorer 
London UK
Site Moderator
 
Experience: Beginner
Platform: CQG
Broker: S5
Trading: Futures
Posts: 6,233 since Sep 2015
Thanks Given: 15,885
Thanks Received: 16,118

Nice stuff @trendisyourfriend

Did you write it yourself?


Reply With Quote
Thanked by:
  #3 (permalink)
 
trendisyourfriend's Avatar
 trendisyourfriend 
Quebec Canada
Legendary Market Wizard
 
Experience: Intermediate
Platform: NinjaTrader
Broker: AMP/CQG
Trading: ES, NQ, YM
Frequency: Daily
Duration: Minutes
Posts: 4,580 since Oct 2009
Thanks Given: 4,266
Thanks Received: 6,199



xplorer View Post
Nice stuff @trendisyourfriend

Did you write it yourself?

Yes, a long time ago. I did ask Gemini to review it and suggest improvements, which it did to some extent. I also asked Gemini to write the post and add a few details, and it did so very well.


Started this thread Reply With Quote
Thanked by:
  #4 (permalink)
 
xplorer's Avatar
 xplorer 
London UK
Site Moderator
 
Experience: Beginner
Platform: CQG
Broker: S5
Trading: Futures
Posts: 6,233 since Sep 2015
Thanks Given: 15,885
Thanks Received: 16,118


trendisyourfriend View Post
Yes, a long time ago. I did ask Gemini to review it and suggest improvements, which it did to some extent. I also asked Gemini to write the post and add a few details, and it did so very well.

Congrats. While I don't use NT for execution myself I'm sure this will come in handy for many.


Reply With Quote
Thanked by:




Last Updated on December 19, 2025


© 2026 NexusFi®, s.a., All Rights Reserved.
Av Ricardo J. Alfaro, Century Tower, Panama City, Panama, Ph: +507 833-9432 (Panama and Intl), +1 888-312-3001 (USA and Canada)
All information is for educational use only and is not investment advice. There is a substantial risk of loss in trading commodity futures, stocks, options and foreign exchange products. Past performance is not indicative of future results.
About Us - Contact Us - Site Rules, Acceptable Use, and Terms and Conditions - Downloads - Top
no new posts