{"id":442933,"date":"2026-11-25T12:08:09","date_gmt":"2026-11-25T05:08:09","guid":{"rendered":"https:\/\/www.swingfish.trade\/blog\/?p=442933"},"modified":"2026-11-25T13:24:59","modified_gmt":"2026-11-25T06:24:59","slug":"swingfish-helper-moving-to-json","status":"publish","type":"post","link":"https:\/\/www.swingfish.trade\/blog\/library\/swingfish-helper-moving-to-json-442933\/","title":{"rendered":"SwingFish Helper: moving to json"},"content":{"rendered":"<div>\n<p>for years the SwingFish Helper reported my trading status the same way: one line of text. <!--more--> <code>Waiting for Trade [+0.318% | 10.4R]<\/code> or <code>\u00b0 Active Positions [-0.024%]<\/code>, and that was it.<\/p>\n<p>it worked. the <a href=\"https:\/\/www.swingfish.trade\/tradingroom\">tradingroom<\/a>, the status box on this site, the <a href=\"\/blog\/library\/ctrader-apple-watch-409812\/\">Apple Watch<\/a>, all of them took that line and showed it. but every single one of them had to <em>read<\/em> it. cut out whatever is inside the brackets, guess the status from the words, hope nobody changes the wording. that\u2019s not data, that\u2019s a screenshot made of letters.<\/p>\n<p>this upgrade is very long overdue: the helper now writes actual data.<br \/>\n<span id=\"more-19176\"><\/span><\/p>\n<p style=\"text-align: center;\"><a class=\"btn btn-success\" href=\"https:\/\/www.swingfish.trade\/swingfish-helper\" rel=\"noopener\">Download the new SwingFish Helper<\/a><\/p>\n<h3>what the helper writes now<\/h3>\n<p><a href=\"https:\/\/cdn.nullx8.com\/cdn\/0x8.in.th\/wp\/2024\/12\/swingfish-helper-json-output.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"alignright wp-image-17973 size-thumbnail\" src=\"https:\/\/swingfish.nullx8.com\/swingfish\/blog\/2026\/11\/swingfish-helper-json-output-303x170-1.jpg\" alt=\"\" width=\"303\" height=\"170\" \/><\/a><\/p>\n<ul>\n<li>you can still use both version there is a seperate json file location setting<\/li>\n<\/ul>\n<p>next to the text file (which stays, the overlay works as before), the helper writes a proper JSON file, every second while positions or orders are open, otherwise once per bar:<\/p>\n<ul>\n<li><strong>Running<\/strong> \u2013 <code>true<\/code> while the cBot runs. stopping it writes <code>false<\/code>, so \u201cstopped on purpose\u201d and \u201ccrashed\u201d are finally two different things.<\/li>\n<li><strong>Today<\/strong> \u2013 the PnL of the day, plus the <strong>highest<\/strong> and the <strong>lowest<\/strong> point the day has reached.<\/li>\n<li><strong>Current<\/strong> \u2013 the result of the open positions, the activity text, and every position and pending order as a list with symbol, side and volume.<\/li>\n<li><strong>Overlay<\/strong> \u2013 which overlay settings are active, so whoever reads the file can rebuild exactly the text you would see.<\/li>\n<li><strong>updated<\/strong> \u2013 a timestamp of the last write.<\/li>\n<\/ul>\n<p>numbers are written the same on every computer no matter the language settings, and the file is written to a temporary file first and then swapped in. the webserver never sees a half written file again.<\/p>\n<h3>how it looks on my side<\/h3>\n<p>my own setup collects this together with other status data (servers, network and so on) into one internal status API. this is what it hands out for cTrader, a few seconds ago, short JPN225 on a slightly red day:<br \/>\n<code>{<br \/>\n\"generated\": \"2026-11-25T04:36:13Z\",<br \/>\n\"ok\": true,<br \/>\n\"sources\": {<br \/>\n\"ctrader\": {<br \/>\n\"ok\": true,<br \/>\n\"stale\": false,<br \/>\n\"updated\": \"2026-11-25T04:36:13Z\",<br \/>\n\"updatedU\": 1795581373,<br \/>\n\"age\": 0,<br \/>\n\"ttl\": 0,<br \/>\n\"error\": null,<br \/>\n\"data\": {<br \/>\n\"raw\": \"\u00b0 Active Positions  [-0.044%]nSell JPN225\",<br \/>\n\"status\": \"active\",<br \/>\n\"pnl\": \"-0.044%\",<br \/>\n\"display\": {<br \/>\n\"text\": \"\u00b0 Active Positions  [-0.044%]nSell JPN225\",<br \/>\n\"li\": \"&lt;ul&gt;&lt;li&gt;\u00b0 Active Positions  [-0.044%]nSell JPN225&lt;\/li&gt;&lt;\/ul&gt;\"<br \/>\n},<br \/>\n\"today\": {<br \/>\n\"gain\": -0.0442,<br \/>\n\"max_gain\": 0.0083,<br \/>\n\"max_loss\": -0.0619<br \/>\n},<br \/>\n\"current_gain\": 0.007,<br \/>\n\"positions\": [<br \/>\n{<br \/>\n\"symbol\": \"JPN225\",<br \/>\n\"side\": \"Sell\",<br \/>\n\"volume\": -22<br \/>\n}<br \/>\n],<br \/>\n\"orders\": [],<br \/>\n\"overlay\": {<br \/>\n\"active\": true,<br \/>\n\"pnl\": true,<br \/>\n\"wifemode\": false<br \/>\n},<br \/>\n\"bot_updatedU\": 1795581373,<br \/>\n\"bot_age\": 0,<br \/>\n\"error\": null<br \/>\n},<br \/>\n\"action\": {<br \/>\n\"effect\": \"a9\",<br \/>\n\"ok\": true,<br \/>\n\"at\": \"2026-11-25T04:06:07Z\",<br \/>\n\"error\": null,<br \/>\n\"gain\": -0.0047<br \/>\n}<br \/>\n}<br \/>\n}<br \/>\n}<\/code><\/p>\n<ul>\n<li><strong>status<\/strong> \u2013 <code>active<\/code> (positions or orders open), <code>waiting<\/code> (running, nothing open), <code>idle<\/code> (bot stopped) or <code>offline<\/code> (the trading computer can\u2019t be reached at all). no more guessing from words.<\/li>\n<li><strong>raw \/ pnl \/ display<\/strong> \u2013 the good old text, rebuilt from the data. every existing page keeps working without knowing anything changed.<\/li>\n<li><strong>today<\/strong> \u2013 the day: <code>gain<\/code> is where it is now, <code>max_gain<\/code> the best and <code>max_loss<\/code> the worst point of the day.<\/li>\n<li><strong>current_gain<\/strong> \u2013 the open position. in this example the position itself is slightly green (+0.007%) while the day is red.<\/li>\n<li><strong>positions \/ orders<\/strong> \u2013 one entry per symbol instead of a line of text.<\/li>\n<li><strong>action<\/strong> \u2013 what my automation did with it (more about that below).<\/li>\n<\/ul>\n<p>and yes, there is a <code>wifemode<\/code>. some traders have a LaMetric clock in the living room, and with wife mode the overlay shows the better of the two numbers: if the day is red but the open position is green, the clock shows the position. the numbers are the same, it\u2019s purely a visual thing (and a running gag from years ago). the data always has the real values, so nothing downstream gets fooled by it.<\/p>\n<h3>where it shows<\/h3>\n<ul>\n<li><strong>swingfish.trade<\/strong> \u2013 the <a href=\"https:\/\/www.swingfish.trade\/tradingroom\">tradingroom<\/a> and the landing page still show the live status text, now coming from the data.<\/li>\n<li><strong>this site<\/strong> \u2013 the status box in the side menu knows the difference between \u201cthe bot is not running\u201d (<em>waiting for cTrader<\/em>) and \u201cthe trading computer is off\u201d (<em>currently off the charts<\/em>).<\/li>\n<li><strong>my desk lamp<\/strong> \u2013 the <a href=\"https:\/\/0x8.in.th\/hacking-10-led-tiles-the-easy-way\" target=\"_blank\" rel=\"noopener\">$10 LED tiles<\/a> turn red on a losing day and green on a winning one. this uses the real value of the day, so wife mode can\u2019t paint a red day green. it only switches when the colour actually changes, not every minute.<\/li>\n<li><strong>my admin dashboard<\/strong> \u2013 the status button changes colour by state and shows the position and the day next to the text.<\/li>\n<\/ul>\n<h3>what you can do with it<\/h3>\n<p>the obvious part: anything that can read JSON can now use your trading status without parsing text. a shortcut on the Apple Watch, a smart home routine, a Stream Deck button, a Discord bot. take <code>status<\/code> to know what\u2019s going on, take the numbers to do math.<\/p>\n<p>the less obvious part: <strong>statistics<\/strong>. since the file has real numbers and a timestamp, you can simply pull it on a schedule and store it, and you get a timeline of your trading day without touching cTrader at all.<br \/>\npulling is not the only way either: the <a href=\"https:\/\/www.swingfish.trade\/swingfish-helper\">SwingFish Helper<\/a> can also <strong>push<\/strong> the data to a server, if you\u2019d rather have the trading computer deliver than have something polling it.<\/p>\n<h3>the numbers nobody shows you<\/h3>\n<p>here is the part I care about most. almost every platform, prop firm dashboard and trading journal shows you one number per trade or per day: the result. +0.4%, nice, next.<\/p>\n<p>but the result alone tells you very little about how you traded. two days that both end at +0.4% can look completely different:<\/p>\n<ul>\n<li>one went straight up and was closed.<\/li>\n<li>the other went -0.6% first, came all the way back, ran to +1.2%, and then you gave two thirds of it back because you didn\u2019t want to exit.<\/li>\n<\/ul>\n<p>same PnL, completely different trader. that\u2019s exactly what <code>max_gain<\/code> and <code>max_loss<\/code> are for, and they are almost always ignored, despite being extremely important.<\/p>\n<p>in my own statistics I use them to build a proper <strong>exposure chart<\/strong>: not just where the day ended, but how it got there.<\/p>\n<ul>\n<li><strong>how much drawdown happened before the profit was taken<\/strong> \u2013 the distance from the lowest point to the close. if that number is regularly bigger than what I end up making, my entries are early or my stops are too wide.<\/li>\n<li><strong>how much profit I left on the table<\/strong> \u2013 the distance from the highest point to the close. if that one is big, the problem isn\u2019t the analysis, it\u2019s me being hesitant to exit.<\/li>\n<\/ul>\n<p>both numbers are uncomfortable, and that\u2019s the point. a PnL chart makes you feel good or bad, an exposure chart tells you what to fix.<\/p>\n<h3>get it<\/h3>\n<p>the new version is available for download on the SwingFish website. update the cBot, enable the statistics file as before (see the <a href=\"https:\/\/0x8.in.th\/ctrader-apple-watch\" target=\"_blank\" rel=\"noopener\">Apple Watch post<\/a> for the setup with XAMPP), and the new JSON is there. the text overlay keeps working exactly as before, so nothing breaks while you switch your things over.<\/p>\n<p style=\"text-align: center;\"><a class=\"btn btn-success\" href=\"https:\/\/www.swingfish.trade\/swingfish-helper\" rel=\"noopener\">SwingFish Helper<\/a><\/p>\n<blockquote><p>if you build something with the data (a widget, a journal, a chart), let me know. I\u2019m curious what other people do with it.<\/p><\/blockquote>\n<\/div>\n","protected":false},"excerpt":{"rendered":"<div>for years the SwingFish Helper reported my trading status the same way: one line of text. Waiting for Trade [+0.318% | 10.4R] or \u00b0 Active Positions [-0.024%], and\u2026<\/div>\n","protected":false},"author":1,"featured_media":442934,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[55],"tags":[117],"class_list":["post-442933","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-library","tag-0x8-trading"],"_links":{"self":[{"href":"https:\/\/www.swingfish.trade\/blog\/wp-json\/wp\/v2\/posts\/442933","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.swingfish.trade\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.swingfish.trade\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.swingfish.trade\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.swingfish.trade\/blog\/wp-json\/wp\/v2\/comments?post=442933"}],"version-history":[{"count":5,"href":"https:\/\/www.swingfish.trade\/blog\/wp-json\/wp\/v2\/posts\/442933\/revisions"}],"predecessor-version":[{"id":442941,"href":"https:\/\/www.swingfish.trade\/blog\/wp-json\/wp\/v2\/posts\/442933\/revisions\/442941"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.swingfish.trade\/blog\/wp-json\/wp\/v2\/media\/442934"}],"wp:attachment":[{"href":"https:\/\/www.swingfish.trade\/blog\/wp-json\/wp\/v2\/media?parent=442933"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.swingfish.trade\/blog\/wp-json\/wp\/v2\/categories?post=442933"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.swingfish.trade\/blog\/wp-json\/wp\/v2\/tags?post=442933"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}