All use cases

Use case · Trading

Market data without the black box

Market data is the part you do not want to rewrite for every idea. On ScriptGraph you can rent a closed feed, see only its ports, and spend your canvas time on the strategy around it. When the strategy is worth keeping, sell it the same way.

What you build

Every graph is a set of small Python nodes wired by ports. These are the pieces this track puts together.

Data in

The Binance category covers ticker price, klines, depth and account endpoints. A closed feed from the store replaces the raw nodes with a single block that exposes symbol in and price out.

Signals

Use SMA, SMA Cross, Rolling Closes and Branch to turn a price stream into a decision, then log it with Print before any order node is involved.

Strategy stays yours

A closed asset is encrypted at rest and decrypted only inside the API at run time. Renters can run it and read its ports; buyers get the source.

Build it step by step

The same five moves work for every graph: add nodes, wire ports, set parameters, run, then save or share.

  1. Get the feed

    Rent Binance Price Feed for 30 days or buy the source outright in the store. The rental and the purchase both land in the editor’s Library.

    binance_ticker_price
  2. Open the public skeleton

    Bob’s Price Feed graph is public and minimal. Open it in the editor to see the project around the closed asset before adding your own logic.

    startprint
  3. Insert the feed

    A rented graph arrives as a locked group with an interface: connect your symbol to its input and read the price from its output. Nothing inside the group is editable, and nothing inside it reaches the browser.

  4. Build the signal

    Feed the price into SMA Cross or compare two rolling closes, then send the result into a Branch. Keep the decision visible even when the data source is closed.

    sma_crossrolling_closesbranch
  5. Log before you trade

    Wire the signal into Print first. Run the graph and check the sequence of events and values in the console; only then connect an order node.

    printbinance_order_buy
  6. Version the idea

    Save the working graph, snapshot it as a new asset version when the strategy changes, and keep the old version available to the people who rented it.

Example you can open now

This example is seeded on the public site. Open the graph in the editor to inspect it, or take a copy through the store when a fork is not enough.

Example asset

Binance Price Feed

GraphClosedRent · 100 SGC / 30 days · Buy · 900 SGC

A closed market-data graph that exposes only its ports. Bob’s public Price Feed graph is the open skeleton around it, and the store asset is the implementation you can rent or buy.

Public ports symbol: strprice: number

How it runs

When a graph with a closed group or node runs, the API checks the entitlement, decrypts the asset in memory, expands or inlines it, and only then forwards the run to the runner. The runner inside the container never sees the store: it executes ordinary node code, and the console shows events outside the closed block without exposing its source.

  • Each graph runs in its own Docker container, started by the API.
  • Nodes are fetched at the exact version the graph pins.
  • stdout and node events stream to the editor console while it runs.

Test a strategy on the canvas

Start with a printed signal and one data source. When the sequence looks right, add the order node and a rental or buyout variant of your own.