⚠ Requires a TradingView account
Pine scripts do NOT run on CryptoLwa. They load into TradingView.com — a free account works. CryptoLwa gives you the scripts and teaches you to use them there; TradingView runs them and fires the alerts that travel down the pipeline below.
THE PIPELINE
How the Whole Thing Connects
A green signal travels from your chart all the way to your scoreboard.
→
📈
TradingView
where it runs
→
→
→
Going deeper — why the chain is built this way
This pipeline is an example of a beautiful engineering idea: separation of concerns. Each stage does exactly one job and hands a clean baton to the next. Pine Script only decides; TradingView only runs the decision against live candles; the webhook only carries the message; the Lasirèn bridge only simulates the fill; Paper Trade only scores. Because the pieces are decoupled, you can improve your strategy without touching the plumbing, or swap the venue without rewriting the logic. The glue between them is a tiny packet of JSON — just labeled text like {"action":"long"} that both sides agree to speak.
The ten-year-old versionThink of a relay race. The brain (Pine) figures out when to run, then passes a baton to a runner (the webhook) who sprints it to the next teammate (the bridge), who hands it to the scorekeeper. Nobody tries to do everyone's job — each teammate is great at one thing, so if one gets faster, the whole team wins.
The single most important word in this whole chain is paper. Every fill is imaginary — real market prices, pretend money. That's not a limitation; it's the entire point. You get to be wrong for free, over and over, until the numbers earn your trust. Real funds move only at your explicit request, with your final say on every trade.
- One job per stage — decide, run, carry, simulate, score; decoupling lets you upgrade any piece without breaking the rest.
- JSON is the baton — a small packet of labeled text is all that travels between stages, which is why any charting tool can plug in.
- Paper first, always — imaginary fills on real prices let you fail for free until a strategy proves itself.
STEP 01
What Is Pine Script?
TradingView's simple language for indicators & strategies.
Indicators draw lines and signals on a chart; strategies are rules that simulate buys and sells. You don't need to be a coder to start — load a ready-made script and press play.
Explain like I'm 10Pine Script is a recipe you hand to a robot chart. The recipe says "if the fast line crosses above the slow line, shout BUY." The robot watches the chart 24/7 and shouts for you.
- MAZAKA · Options-Regime — picks long/short by trend × volatility, with built-in stops & targets.
- GEDE4 — the master momentum/volatility indicator whose alerts are pre-shaped for CryptoLwa's webhook.
Going deeper — how Pine actually "thinks"
Pine has one quirk worth understanding: it runs once per candle, left to right across history, as if reliving the chart bar by bar. On each bar it can see the past but never the future — a safeguard against fooling yourself. The trap that ruins beginner strategies is repainting: a signal that looks perfect on history because it secretly used information that wasn't available yet in real time. A backtest that repaints is a mirage — it "predicts" moves it actually peeked at. Honest Pine waits for a bar to close before trusting a signal, which is why barstate.isconfirmed and closed-candle logic matter so much.
The ten-year-old versionImagine grading your own homework, but you're only allowed to use what you knew before you saw the answer key. Repainting is like sneaking a peek at the answers and then bragging you got them all right. It feels great until the real test — the live market — where there's no answer key to peek at.
This is also why the difference between an indicator and a strategy matters. An indicator just draws — lines, labels, alerts. A strategy simulates actual buys and sells and produces a strategy tester report you can grade. For CryptoLwa, the ready-made scripts like MAZAKA and GEDE4 are pre-shaped so their honest, closed-bar alerts drop straight into the webhook — no peeking, no repainting.
- Bar-by-bar execution — Pine relives the chart one candle at a time and can never see the future, by design.
- Repainting is the great deceiver — a signal that used not-yet-available data looks brilliant on history and fails live; trust closed-bar signals only.
- Indicator vs. strategy — one draws, the other simulates trades and gives you a testable scorecard; you want the scorecard.
STEP 02
Load a Script on TradingView
Paste, save, add to chart.
- Open TradingView, pick a chart (e.g. BTCUSD), open the Pine Editor (bottom panel).
- Paste a CryptoLwa script (e.g.
MAZAKA-OPTIONS-REGIME.pine), click Save, then Add to chart.
- You'll see the regime label, entries/stops, and the strategy-tester results appear.
Heads-upSending alerts to a webhook needs a paid TradingView plan. On the free plan you can still run the script and get email/popup alerts — then place the paper trade manually on CryptoLwa.
Going deeper — reading the strategy tester before you trust it
When you add a strategy to a chart, TradingView runs it across all visible history and hands you a strategy tester report — and learning to read it skeptically is the whole game. The headline number is net profit, but that's the least trustworthy figure. Look instead at number of trades (fewer than ~30 and the results are noise), max drawdown (the worst peak-to-valley pain you'd have had to sit through), and profit factor (gross wins ÷ gross losses; above 1.5 is respectable). A strategy that made money on three lucky trades has proven nothing at all.
The ten-year-old versionIf someone says "I'm great at basketball, I made 2 out of 2 shots!" you'd laugh — two shots proves nothing. But "I made 300 out of 500 over a whole season" means something. A backtest is the same: a handful of wins is bragging; hundreds of trades across good times and bad is evidence.
Two silent killers hide in pretty backtests. The first is ignoring fees and slippage — a strategy that trades constantly can look brilliant until real costs eat every edge. The second is overfitting: tuning the inputs until the strategy perfectly fits the past, which almost guarantees it breaks on the future. The cure is exactly what this lesson builds toward — prove it forward in paper, on data the strategy has never seen, before you believe a single number.
- Sample size first — under ~30 trades, treat every metric as noise; you need many trades across different conditions.
- Drawdown & profit factor over net profit — the pain you'd endure and the win/loss ratio tell you far more than the headline gain.
- Fees, slippage, overfitting — the three ways a gorgeous backtest lies; forward-test in paper to catch them.
STEP 03
Wire the Alert into CryptoLwa
Right-click → Add alert → your script → Any alert() call.
Then set the webhook destination and the message — a short JSON that includes your secret token:
Webhook URL
https://www.cryptolwa.io/api/gede4/webhook
Alert message (JSON)
{
"token": "<your GEDE4_WEBHOOK_SECRET>",
"symbol": "{{ticker}}",
"action": "long",
"price": {{close}}
}
- The token must match the
GEDE4_WEBHOOK_SECRET in your site settings — it's how the site knows the alert is really yours.
- Click Create. Now every time the script fires, TradingView POSTs the signal to CryptoLwa.
- What happens next: the webhook stores the latest signal; the Lasirèn bridge runs in paper mode, simulates the swap, and records a fill. No real funds, ever, unless you explicitly go live.
Going deeper — what a webhook is, and why the secret token matters
A webhook is just an automatic phone call from one program to another. When your alert fires, TradingView makes an HTTP POST — it "phones" the URL you gave it and delivers your JSON message. The receiving end (CryptoLwa) picks up, reads the message, and acts. There's no polling, no waiting; the event pushes itself the instant it happens. That's why it's near-instant compared to a program that has to keep asking "anything new yet?"
The ten-year-old versionInstead of you checking the mailbox every five minutes to see if a letter came, a webhook is a doorbell: the moment there's news, it rings and hands the message straight to you. Faster, and you never miss it.
But an open doorbell anyone can ring is dangerous — a stranger could push fake "BUY" signals into your account. That's the entire job of the secret token in the JSON. It's a shared password only you and the site know; the webhook checks it on every message and ignores anything without the right token. This is why you never paste your GEDE4_WEBHOOK_SECRET into a public place, and why CryptoLwa verifies it server-side before a signal is allowed to touch even the paper engine. Authentication first, action second — always.
- Webhook = a push, not a poll — the event phones the URL the instant it happens, which is why alerts arrive near-instantly.
- The token is a password — it proves the signal is really yours; the site rejects any message without it, blocking forged trades.
- Keep the secret secret — never post your webhook token publicly; anyone holding it could send signals in your name.
STEP 04
Trade It in Paper Trade
A flight simulator for trading — pretend money, real lessons.
- Automatic — the 24/7 paper engine reads signals and simulates entries on a cadence; you just watch.
- Manual — use the dispatch controls to fire a chosen agent's picks into the bridge (paper).
- Each simulated fill is recorded with symbol, side, size, and an entry price from live market data.
Going deeper — why paper trading is real practice, not a toy
The point of paper trading is forward-testing: proving a strategy on data it has never seen, in real time, as the future unfolds. A backtest can be quietly overfit to the past; a forward paper run can't cheat, because tomorrow's candles genuinely don't exist yet. The bridge simulates the swap using live market prices so your fills reflect real conditions — spread, timing, the whole texture of the market — just without real money at risk. That's the closest thing to live trading that can't hurt you.
The ten-year-old versionIt's a flight simulator. A pilot doesn't learn to fly by reading about old flights (backtesting) — they climb into a simulator that behaves exactly like a real plane, crash a hundred times for free, and only fly passengers once the simulator says they're ready. Paper trading is your cockpit before the real skies.
Paper trading also trains the part of you that's hardest to fix: your own behavior. It reveals whether you'll actually let a strategy run without fiddling, whether you can sit through a drawdown, whether you respect the exit plan. The one honest limit to remember — paper trading can't fully reproduce the emotion of real money, so real capital always deserves extra caution and, on CryptoLwa, your explicit final say on every trade.
- Forward-testing can't cheat — the future is genuinely unknown, so a paper run tests the strategy honestly in a way backtests can't.
- Live prices, no risk — fills reflect real market conditions while the money stays imaginary; the safest real practice there is.
- It trains behavior, not just the system — paper reveals your discipline, but can't fully mimic real-money emotion, so stay cautious going live.
STEP 05
Monitor Your Progress
Read the scoreboard like a scientist.
Your blotter and the agent journal track open & closed positions, win rate, average win/loss, expectancy, and drawdown — all computed from your closed paper trades.
The honest barOne good trade proves nothing. Look for positive expectancy over 20+ closed paper trades before you trust a strategy. Then tune one input, re-test, and compare.
- Load MAZAKA on a BTC chart; add the alert with your token.
- Let it run a week in Paper Trade — don't touch it.
- Check the scoreboard: positive expectancy over ≥20 closed trades? Worst drawdown?
- Adjust ONE input, re-run, compare. Approve a tweak only if the data backs it.
Going deeper — the scoreboard metrics that actually matter
Reading your blotter like a scientist means knowing which numbers carry weight. Win rate is the most overrated — you can win 40% of the time and still be hugely profitable if your winners dwarf your losers. The number that ties it all together is expectancy: on average, how much do you make (or lose) per trade? A positive expectancy over a real sample is the only proof that matters. Pair it with the average win vs. average loss ratio and max drawdown, and you have an honest portrait of the strategy's character — not just whether it won, but how it won and what it cost you emotionally.
The ten-year-old versionWinning a lot of tiny games but losing a few huge ones can still leave you broke. What matters isn't how often you win — it's whether, after adding up every win and subtracting every loss, you end each round a little richer on average. That average-per-round is the only score that tells the truth.
The final discipline is change one thing at a time. If you tweak three inputs at once and results improve, you'll never know which change helped — or whether you just got lucky. Adjust a single dial, re-run over 20+ closed trades, and keep the change only if the data clearly backs it. This is the scientific method wearing a trader's hat, and it's exactly the loop MAZAKA uses to improve itself: hypothesis, test, measure, keep or discard.
- Expectancy over win rate — average profit per trade is the real verdict; a low win rate with big winners can crush a high win rate with tiny ones.
- Character, not just outcome — pair expectancy with avg win/loss and max drawdown to see how a strategy wins and what it costs you.
- One variable at a time — isolate each change over a real sample so you know what actually helped; that's the self-improvement loop.
That's the whole loop: Pine decides, TradingView runs, the webhook carries, the bridge simulates, the scoreboard judges. Practice in paper until the numbers earn your trust — and real-money trading happens solely at your explicit request, with your final say on every trade.