
Completed
Posted
Paid on delivery
I’m building a TradingView strategy in Pine Script v6 to generate clean long- and short-side signals on the S&P 500 futures contract. The calculations for my indicators are already in place, but the decision layer has grown into several levels of nested if/else blocks inside a for-loop, making the script hard to read, slow, and occasionally unpredictable. Your task is to refactor this section so the logic is both readable and efficient while preserving every numerical output the script currently produces. Please streamline the conditional structure, keep loops only where they truly add value, and comment each step so I can follow the flow and tweak parameters later. Specific issues to address: 1) The "if" statement based on a calculated slope is not working as it should. 2) The "for" loops seem to be executing beyond their intended range. 3) The strategy entry is generating a buy order on every bar. Additionally, I am looking for someone who will focus on fixing these specific issues without rewriting my entire logic. These challenges stem from adapting Fortran-based coding principles to Pine Script. Deliverables: • Revised .pine file written in Pine Script v6 • Clear in-code comments explaining each conditional branch and loop • A short note outlining what was changed and why Acceptance criteria: The updated script must compile and run on TradingView without errors, plot the same values as the original on “ES1!” continuous futures data, trigger a single alert per entry/exit, and avoid repainting. Once you’re comfortable with the scope, I’ll share the current code so you can get started right away.
Project ID: 40735126
40 proposals
Remote project
Active 6 days ago
Set your budget and timeframe
Get paid for your work
Outline your proposal
It's free to sign up and bid on jobs
40 freelancers are bidding on average $450 USD for this job

Hi, I understand that your indicator calculations are already working, but the signal decision layer has become difficult to follow because of nested if/else blocks and a for-loop. I will refactor the Pine Script v6 logic without changing its numerical results, keeping only useful loops and making each branch clear with simple comments. I will test the revised strategy on ES1! continuous futures data, check that it compiles without errors, preserves long and short signals, produces one alert per entry and exit, and does not repaint. I will also review the conditions for efficient execution and provide a short note explaining the changes. My approach will use clean Algorithm structure, careful Backtesting against the existing output, and clear Data Visualization checks for plots and signal timing. I can begin once you share the current .pine code and any required alert settings. Can you share the current .pine file, along with the exact Pine Script version and examples of any signals that currently behave incorrectly? Thank you.
$750 USD in 10 days
5.9
5.9

The real risk here is that nested if/else inside a for-loop usually means conditions are checking lagged bar states or recalculating the same value multiple times, and pulling that apart without changing which bar triggers the signal is where most refactors quietly break. I'd flatten it by hoisting repeated calculations outside the loop, converting stacked conditionals into named boolean variables that document intent, and confirming bar-by-bar output matches the original on a 90-day ES1! backtest before handing it over. I just finished optimizing an EMA strategy in Pine Script with TP/SL permutations across 1,260 combinations and delivered clean commented code with a PDF breakdown. I also run a live TradingView webhook bridge that routes alerts to 8 broker accounts, so I'm used to catching repaint traps and alert-doubling edge cases that only show up under real conditions. You can see that and the travel planner at ffulb.com. I'd want to see the current script to confirm there isn't a calc_on_every_tick or varip issue hiding in the loop before quoting a firm number.
$400 USD in 7 days
5.8
5.8

Hello! My name is Quadri, and I’m a highly skilled MetaTrader, ThinkorSwim (TOS), and Pine Script developer with over five years of experience. I have successfully built high-performance trading bots, strategies, and indicators for various brokers and platforms. My focus is on developing efficient, reliable, and solutions tailored to your trading needs. I’d love to discuss your project in detail and explore how I can help optimize your trading strategies. Let’s connect.
$500 USD in 5 days
4.9
4.9

You can check my profile to see that I've just completed jobs on Pine Script. I am an experienced Pine Script developer with a proven track record of delivering high-quality, efficient code. I understand the importance of readability and performance in trading strategies, and I'm confident I can help you simplify your Pine Script signal logic while preserving its numerical outputs. I will refactor your Pine Script to streamline the conditional structure, keeping loops where they add value and adding clear comments to explain each step. This will ensure your script is both readable and efficient, allowing you to easily follow the flow and make adjustments as needed. I will deliver a revised Pine file, clear in-code comments, and a short note outlining the changes made and their reasoning. Thanks, Adegoke M.
$375 USD in 3 days
4.4
4.4

I can refactor your Pine Script v6 decision layer to produce identical signals with clean, readable logic that runs faster and never repaints. I will start by mapping your nested if/else blocks and for-loop into a decision table capturing every branch. Then I will flatten conditionals into clear boolean signal expressions, replace the loop with Pine's native series operations where equivalent, and keep loops only where they add value. Each branch gets concise comments and thresholds become tweakable inputs. I will validate by running both versions on ES1! data, comparing every value and signal, and confirming single alerts per entry/exit with no repainting. I have built trading automation systems including strategy logic and signal generation, so Pine Script's execution model, barstate behaviour, and repainting pitfalls are familiar ground for me. Two quick questions: is this an indicator or a strategy, and which signals must stay identical? Should logic use confirmed bars strictly, or preserve current bar behaviour? Share the code and I will start right away.
$450 USD in 7 days
2.7
2.7

Hi — Bravion here from Cleveland. I see you need your Pine Script v6 strategy refactored to simplify the signal logic for S&P 500 futures while keeping all outputs intact. My approach will focus on improving readability and efficiency without changing any numerical results. - Extensive experience writing and optimizing Pine Script strategies on TradingView - Skilled at restructuring nested if/else logic into clean, maintainable code with clear comments - I will ensure your script compiles error-free, triggers one alert per entry/exit, and avoids repainting - I’ll provide a detailed summary explaining the changes and rationale for easy future tweaks Looking forward to helping you streamline your strategy and improve maintainability. Let’s get started as soon as you’re ready!
$500 USD in 3 days
2.3
2.3

Hello!⚡ Thank you for posting your Simplify Pine Script Signal Logic project. Refactoring tangled Pine Script decision logic into clean, fast, verifiable code is exactly the kind of trading work I do. I recently refactored a Pine v6 ES strategy, replacing nested if/else inside a loop with named boolean conditions and a switch, with identical outputs and faster execution. How I'd approach yours: 1. Map every branch of the current logic and record baseline plots and signals on ES1! 2. Replace nested if/else with named conditions and switch blocks, keeping loops only where needed 3. Move repeated calculations out of the loop to cut runtime 4. Confirm signals on bar close so nothing repaints, with one alert per entry/exit 5. Compare old and new plots bar by bar so every value matches 6. Clear in-code comments plus a short change note on what changed and why I'll keep your logic intact and far easier to tweak, and make this a success with you. Thanks. Hassan
$500 USD in 3 days
0.0
0.0

Hi I can refactor your Pine Script v6 strategy while preserving the existing numerical behavior and long/short signal logic. I will first establish the current ES1! outputs as the baseline, then simplify the nested if/else decision layer into clear conditions and reusable logic. I will remove unnecessary loop work where possible while keeping any iteration that is required to produce identical results. Special attention will be given to Pine execution behavior, bar confirmation, state handling, and alert conditions so the revised strategy remains non-repainting and produces only one alert per intended entry or exit. The final .pine file will compile cleanly on TradingView and include concise comments explaining the decision flow, conditions, and any remaining loops. I will also provide a short change summary explaining the optimization and why each structural change was made. I am ready to review the existing script and start immediately. Best, Justin
$500 USD in 7 days
2.8
2.8

Hi- Daniel from Ohio here, TradingView strategies in Pine Script v6 often accumulate redundant conditional checks that make signal management difficult to maintain during backtesting. If the current long and short side logic is triggering phantom signals or conflicting entries, we likely need to refactor the state management so each signal is mutually exclusive and follows a strict hierarchical priority. How I'd fix it: I start by mapping your existing logic into a centralized truth table to identify where overlap occurs between your primary trend filters and entry triggers. I then implement a modular approach using variable-based state tracking to ensure that the script only evaluates a short entry after a specific long exit condition is satisfied, preventing signal bleeding. I will replace repetitive if-else blocks with clear switch-like logic or consolidated Boolean flags to reduce complexity, then execute a series of backtests against different market regimes to confirm that signal behavior remains consistent across varying volatility levels. Are you currently filtering signals based on specific higher timeframe data, or is your logic strictly contained within the active chart timeframe? Thanks, Daniel
$250 USD in 6 days
0.0
0.0

The three issues you added — the slope-based if, for loops running beyond their intended range, and entries firing a buy order on every bar — are exactly the parts I would isolate first rather than rewriting your entire strategy. I develop and test my own TradingView/Pine Script strategies and algorithmic trading systems, so I understand that the important part here isn't simply making the code cleaner. The refactor must preserve the strategy's existing numerical behaviour while fixing execution logic without introducing repainting. My approach would be to establish the current ES1! output as the baseline, trace those three problem areas individually, simplify only the necessary branches/loops, and then compare the revised script against the original. I’ll specifically verify: - the calculated slope condition triggers correctly; - loops execute only over their intended range; - entries fire once per valid signal rather than repeatedly on every bar; - plots/numerical outputs remain consistent with the original; - entry/exit alerts fire once as required; - no repainting is introduced. You’ll receive the revised Pine Script v6 file, clear comments around the changed logic, and a short explanation of exactly what was changed and why. I can start as soon as you share the current script. Vitali
$350 USD in 3 days
0.0
0.0

⭐⭐⭐ Hi, I understand you have a Pine Script v6 strategy for S&P 500 futures where the indicators work but the decision layer has become nested if/else blocks inside a for-loop, making it slow, hard to read, and occasionally unpredictable. You need it refactored while producing identical numerical outputs. I would first map the current logic branch by branch so nothing changes numerically. Then I would flatten the nesting into clear, earlier-return logic or named helper functions, since deep nesting and loop-scoped variables are the usual cause of unpredictable behaviour in Pine. I would keep loops only where they add value and replace the rest with vectorised series operations, which are faster and easier to reason about. I would comment every branch and loop so you can follow the flow and tweak parameters later, and I would be careful about repainting by using confirmed bar data and avoiding forward-referencing security() calls, while ensuring a single alert fires per entry and exit. You would get the revised .pine file in v6, in-code comments, and a short note on what changed and why. I would verify it compiles without errors, plots the same values on ES1!, and does not repaint. Send the code and I can start right away. Thanks
$500 USD in 7 days
0.0
0.0

I write and refactor Pine Script regularly (TradingView strategy backtesting). My approach: (1) snapshot the current script's plotted values and signal bars on ES1! as a baseline before changing anything; (2) replace the nested if/else inside the loop with named boolean conditions and a single switch-based decision step, computed once per bar, keeping loops only where they aggregate over a lookback; (3) one alert per entry/exit via position-change checks on confirmed bars, and no repainting (no lookahead, confirmed-bar logic); (4) verify by diffing plotted values against the baseline across the full ES1! history. Deliverables: revised v6 .pine, comments on every branch, and a change note with the before/after comparison. 3 days after I receive the code.
$350 USD in 3 days
0.0
0.0

Hi. This is a good fit because Pine Script signal logic is usually less about basic conditional execution and more about optimizing nested decision structures so existing indicator calculations continue working. I have experience with Pine Script v6, algorithmic trading, backtesting, financial analysis, and data visualization for complex market strategies. The main technical issue in TradingView strategy development is that deeply nested if-else blocks within loops create significant execution overhead, which can cause script compilation errors or unpredictable signal outputs during live market data processing. I would solve this by refactoring the nested logic into modular functions, replacing inefficient iterative loops with vectorized operations where possible, and documenting each conditional branch with clear comments to ensure the flow remains readable and maintainable for your future parameter adjustments. I can also configure the alert conditions and signal triggers so the system works fully after completion without any repainting issues on the ES1 futures contract data. The goal is to make the system run exactly like a clean, efficient, and professional trading strategy and ensure everything is tested and stable. And I can help you so on. Thanks.
$500 USD in 7 days
0.0
0.0

Hi! Refactoring nested conditional branching in Pine Script v6 requires streamlining state logic, eliminating redundant for-loops, and ensuring 100% numerical signal parity on S&P 500 futures (ES1!) without execution repainting. As an MBA and Senior Quantitative Risk Consultant, I specialize in mathematical modeling, code optimization, and algorithmic execution logic. Here is my execution plan for your ES1! strategy: 1. Logic Streamlining & Vectorization: • Deconstruct nested if/else ladders into clean, modular boolean state flags (e.g. entry/exit conditions isolated into readable variables or switch constructs). • Eliminate unnecessary for-loops by leveraging Pine Script's built-in series execution model, significantly accelerating runtime calculation speed. 2. Strict Signal Parity & Anti-Repainting: • Ensure every single numerical output, plot, and alert trigger produces the exact identical historical and real-time signals as your baseline script. • Zero repainting guarantee across bar closes on ES1! continuous futures. 3. Deliverables: • Clean, fully documented .pine file written in modern Pine Script v6 syntax. • Concise refactoring memo detailing architectural changes, performance gains, and parameter tuning notes. Ready to review your script and start immediately. Best regards, Javier De León, MBA Senior Quantitative Risk & Analytics Consultant
$320 USD in 2 days
0.0
0.0

Hi, I am Ryan from San Francisco. Quick flag before I dive in: in Pine v6 the script already re-runs once per bar, so the slowdown and occasional unpredictability probably isn't the nesting itself, it's the for-loop re-scanning past bars every time instead of carrying state forward. Swapping that for var-based variables that update once per bar close usually fixes both the speed and the flaky signals at once, and it naturally avoids repainting since nothing looks back across history at runtime. One thing worth confirming before I touch the code: you want every numerical output preserved, but also want the occasional unpredictability gone. If that came from a subtle lookahead quirk in the original logic, a handful of historical entries/exits may shift by a bar once that's fixed. Is exact bar-for-bar match the priority, or is matching the intended signal logic, with the flakiness actually resolved, the real goal? Once I see the .pine file I can confirm the number, but for a decision layer of this size: $250 fixed, 2-3 days, fully commented, tested against ES1! for matching plots and one alert per entry/exit. Best, Ryan
$250 USD in 2 days
0.0
0.0

Hi! I'm Anesia from Namibia and happy to help! What caught my attention about your project is that you already have a clear idea of what you want to achieve. I enjoy working with clients who have a vision and need the right people and organization to turn that idea into something real. I understand the importance of having a clean and efficient Pine Script for your TradingView strategy. I will focus on refactoring your nested if/else blocks and loops while ensuring that the logic remains intact and your numerical outputs are preserved. My aim is to streamline your code, address the specific issues you've highlighted, and provide clear comments for future adjustments. I’m not here to simply pass your project on and disappear. I want to make sure you feel supported and that the final result matches what you had in mind. I’d really like to learn more about your project and see how I can help bring it together. Let's do it! Best Regards, Anesia
$350 USD in 7 days
0.0
0.0

I do both MQL5 and Pine Script, so this is right up my expertise. Nested if/else inside a for-loop is a classic Pine Script problem. It works, but it's slow and a pain to follow, and easy to mess up when you're not careful when touching it. I have worked with codes with thousands of lines of code, so slow execution and lagging code are problems I deal with regularly. I will flatten the conditional logic, only keep loops where they're actually needed, and comment each part so you can follow along and tweak it yourself later. I will make sure it compiles cleanly, plots the exact same values on ES1!, still fires one alert per entry/exit, and doesn't repaint. Send over the current code whenever you're ready, and I'll get started. Thanks, Amon
$250 USD in 7 days
0.0
0.0

Acworth, United States
Member since Sep 26, 2026
₹12500-37500 INR
$30-250 USD
$15-25 USD / hour
₹37500-75000 INR
£250-750 GBP
₹37500-75000 INR
$10-30 USD
$30-250 USD
$16-65 HKD / hour
₹750-1250 INR / hour
$10-30 USD
$5000-10000 USD
$10-30 USD
$30-250 USD
₹750-1250 INR / hour
₹600-1500 INR
₹750-1250 INR / hour
£18-36 GBP / hour
min $50 AUD / hour
₹400-750 INR / hour