Skip to main content
Home / Guides / NinjaTrader 8 / PFX Perps Bridge
Guide · NinjaTrader 8 · about 20 minutes

Connect NinjaTrader 8 to MyFundedPerps.DryRun first, one step at a time.

Written by Dan Freeman · last checked

By the end, the bridge is installed, your API key is in place and a DryRun check has read your MyFundedPerps account and printed the order it would send. Nothing in this guide sends an order. Going Live is a separate choice, at the end, and it is yours.

~20 minstart to finish
7 stepstick each one off
DryRunnothing is sent
Freev1.04, source included
✓
The check in this guide cannot trade.

PFX Perps Check runs in DryRun only: there is no setting to change that. It reads your account and prints. If a step doesn't look like the picture, open the "Not seeing it?" box under it.

0

Before you start

Four quick things. Tick them as you go.

BTCUSD says "Symbol is inaccessible"? In NinjaTrader: Tools → Options → tick Multi-provider, add a Coinbase connection, then Market data → Preferred connections → Cryptocurrency (real-time and historical) = Coinbase. Restart NinjaTrader.
1

Download the bridge

One small zip file, about 25 KB.

  1. Open the PFX Perps Bridge page and press Download free · v1.04.
  2. Find PFX_PerpsBridge_NT8.zip in your Downloads folder.
  3. Right-click it → Extract All… → Extract.
You should see a folder with 5 files:
.csPFX_PerpsBridge.cs.csPFX_PerpsCheck.cs.mdREADME.md.mdSETTINGS.md.htmlSETTINGS.html
Not seeing it?

Windows says the download might be unsafe. That warning appears for any new file from a small website. The two code files are plain text you can open and read. Choose Keep.

I can't find the zip. Press Ctrl + J in your browser to open your downloads list.

2

Put the two code files in NinjaTrader

Two files, two folders.

  1. Copy PFX_PerpsBridge.cs into:
    Documents\NinjaTrader 8\bin\Custom\AddOns
  2. Copy PFX_PerpsCheck.cs into:
    Documents\NinjaTrader 8\bin\Custom\Strategies
    Tip: click the address bar at the top of File Explorer, paste the path, press Enter.
File Explorer
Documents › NinjaTrader 8 › bin › Custom
.csPFX_PerpsBridge.cs
.csPFX_PerpsCheck.cs
AddOns · Strategies
.csAddOns\PFX_PerpsBridge.cs
.csStrategies\PFX_PerpsCheck.cs
Ctrl+C then Ctrl+V
One file in each folder
Different folders on purpose. The bridge is an add-on; the check is a strategy, so it shows up in the chart's Strategies list.
3

Tell NinjaTrader to read it

One key press. This is called "compiling".

  1. In NinjaTrader: New → NinjaScript Editor.
  2. Click anywhere in the editor, then press F5.
  3. Wait for it to finish. No red errors at the bottom means both files are installed.

The bridge stays quiet after F5: it only talks when a strategy uses it. You'll see it speak in step 5.

NinjaScript EditorReady
namespace NinjaTrader.NinjaScript.AddOns
{
  public sealed class PfxPerpsBridge
  …
F5
NinjaScript Editor · Errors
No errors
Compiled. Nothing else happens yet
Not seeing it?

Red errors after F5. Check each file is in the right folder (step 2). If it still errors, copy the red text and send it to us.

An error mentions another file, not a PFX one. NinjaTrader compiles every script together, so one broken script stops them all. Fix or remove that file first.

4

Save your API key

One line, in one file, on your PC.

  1. In your MyFundedPerps dashboard, create an API key and copy it.
  2. Open Documents\NinjaTrader 8 and make a folder called PFX (if it isn't there).
  3. In PFX, make a text file called perps_api_key.txt. Paste only the key into it: no spaces, nothing else. Save it.
Documents\NinjaTrader 8\PFX\perps_api_key.txt
Your keyThe answer
Where is it kept?Only in that file, as plain text, on your PC.
Where does it go?Only to MyFundedPerps (developers.myfundedperpetuals.com), in the request header, over HTTPS.
Does PrecisionFX see it?No. The bridge talks to MyFundedPerps directly.
Is it ever shown?No. The Output window only says API key found or MISSING.
Is it encrypted?No. Anything that can open files in your Windows account can read it. Keep your PC locked.
Cloud sync?If OneDrive or Dropbox syncs your Documents folder, this file is synced too.
How do I switch it off?Delete the file. Think someone has seen the key? Revoke it at MyFundedPerps and make a new one.
Not seeing it?

The file is called perps_api_key.txt.txt. Windows hides the ending. In File Explorer: View → Show → File name extensions, then rename it.

I pasted the key into a chat or email. Revoke it at MyFundedPerps and make a new one. The key is a password for your account.

5

Run the DryRun check

No signal needed. Nothing is sent.

  1. Open a BTCUSD chart with live data (any timeframe).
  2. Right-click the chart → Strategies… → add PFX Perps Check → tick Enabled → OK.
  3. Open New → NinjaScript Output and wait a few seconds for a live price.
You should see these lines (your prices will differ):
PFX PERPS CHECK 1.00 (bridge 1.04) - DryRun ONLY: reads your MyFundedPerps account and prints the order it would send. It cannot send an order.
PFX PERPS [Check] BRIDGE DRYRUN - 0.001 BTC / 0.01 ETH, leverage 2, account the single active one, API key found
PFX PERPS [Check] pfx-check-btc-…-l DryRun - DRY RUN - would send {…"side":"buy","type":"market","size":0.001,…}
PFX PERPS CHECK - PASSED: the key worked, the account, market and live quote were read, and the order above is what Live would send. NOTHING was sent.

Then disable PFX Perps Check. To check again, enable it again.

Not seeing it?

"API key MISSING" or "NOT PASSED (Skipped): no API key". The file isn't where step 4 says, or it is empty.

"returned 401". MyFundedPerps did not accept the key. Copy it again: only the key, no spaces.

"more than one active account". Your key sees several accounts. Put the one you want in the strategy's Account id setting.

"is not a BTC or ETH chart". Use a BTCUSD or ETHUSD chart, not a futures contract.

"market already holds position … NOT adopted". You already have a BTC position. The bridge never touches it; the check still proves the key and account work.

"size rounds to zero". The size is below the market's smallest step. Raise BTC size in the check's settings.

Nothing at all. The strategy only starts on a live price: check the chart is connected and not on Playback.

6

Use it with a strategy

DryRun on real signals first. Live is your call.

  1. Open the strategy's settings on a BTCUSD chart and find the D · Perps bridge group. It starts Off.
  2. Set Send signals to MyFundedPerps to DryRun. Set BTC size to 0.001 and ETH size to 0.01.
  3. Enable it. The Output window says BRIDGE DRYRUN. On every signal you'll see DRY RUN - would send …. Watch several.
  4. Only when every DryRun order looks right, choose Live. The Output window then says *** LIVE: orders go to MyFundedPerps and NinjaTrader takes NONE ***.
PFX strategies are released one at a time, each after its testing, and each ships with the bridge Off. Writing your own NinjaScript strategy? The bridge's source is included and the README shows the calls.
!

Live places real orders

On your own MyFundedPerps account, with its own daily loss and drawdown rules. Start at the smallest size and keep NinjaTrader running: if it closes, an open position keeps its stop and target at MyFundedPerps, but the bridge stops managing that trade.

Your safety nets

Three ways to stop it.Always available.

1

Mode Off

Set the strategy's bridge mode to Off. Nothing more goes to MyFundedPerps. Open positions keep their stop and target there.

2

Disable the strategy

Untick Enabled. No new signal is sent. Manage any open position yourself on MyFundedPerps.

3

Delete the key file

Without perps_api_key.txt the bridge cannot reach your account at all. It says no API key and sends nothing.

If something looks off

What the bridge is telling you.In plain English.

Every line starts with PFX PERPS. Find yours here.

It saysWhat it meansWhat to do
BRIDGE OFFThe strategy trades NinjaTrader as normal.Nothing, unless you want DryRun.
API key MISSING / no API keyNo key file, or it is empty.Step 4.
returned 401MyFundedPerps did not accept the key.Copy the key again, only the key.
no active MyFundedPerps account foundThe key sees no active account.Check the account in your dashboard.
more than one active accountThe key sees several accounts.Fill in account id.
is not a BTC or ETH chartThe chart is another market.Use BTCUSD or ETHUSD.
market already holds position … NOT adoptedThere is already a position on that coin.Nothing. It is never touched.
size rounds to zeroThe size is below the market's step.Use a bigger size.
another BTC call is in flightTwo requests at once.Nothing. It carries on next bar.
All done

You're set up.Nicely done.

Next: watch DryRun on real signals for a while before you think about Live.

Risk warning: Crypto perpetual futures are high risk. Prices move fast, around the clock, and leverage magnifies losses: you can lose your whole account balance. In Live mode PFX Perps Bridge places real orders on your own MyFundedPerps account. PrecisionFX is not affiliated with MyFundedPerps, and nothing here is financial advice. NinjaTrader is a registered trademark of NinjaTrader Group, LLC; PrecisionFX is not affiliated with or endorsed by NinjaTrader.