I need an expert in PineScript to modify code for a strategy, so that the Recalculate "After Order is Filled" parameter works correctly.
This example strategy will indicate what I am trying to achieve:
- Whilst 20 EMA > 50 EMA, continually enter Long Positions on each candle, with 2% Take Profit Target, and 4% Stop Loss Target
- If the Take Profit or Stop Loss is hit on the SAME CANDLE that the Long Position was entered, then the position must exit on that candle where it was hit. This is why the Recalculate "After Order is Filled" parameter is crucial for this strategy
I've found that if you simply just turn on the "After Order is Filled" parameter, TradingView behaves strangely and creates entry orders at the highs and lows of the candles (see screenshot 1 and the associated code attached).
I've tried modifying this to restrict long entries, however as you will see this only works for every second candle (see screenshot 2 and the associated code attached)
To reclarify exactly what I need, is for every candle where the long condition is met (ema 20 > ema 50), it must enter a long position, and set the TP / SL. If those targets are hit on the same candle where the position was entered, then the position must exit on that candle where those targets were hit
Thanks for attaching both versions of the code to your project, that made it much easier for me to diagnose your problem and figure out the solution(s).
There are a few things we could do to make this script work better, depending on the answers to the following;
* Do you want multiple positions to open at once, or just one
* If it's opening multiple positions, do you want the TP / SL to be unique for each position
* Are we sure we really need "calc on order fills" turned on? It can cause indicator repainting issues if you use it with more complex scripts
Let me know and I'll fix your script up asap and let you know what was causing the problem too.
Mike
$30 AUD in 2 days
5.0
(11 reviews)
4.5
4.5
7 freelancers are bidding on average $137 AUD for this job
Hi. I am a professional coder in the development of Bots, EAs, Indicators and Scripts for TradingView and MT4/MT5, and I already did similar projects to this job successfully.
Please let us talk about the details of the job, so that we can do this job as you expect.
Hello,
I understand your need to ensure precise execution of your Pine Script strategy with the "Recalculate After Order is Filled" parameter. Here's how I can help:
1. **Issue Diagnosis**: I'll identify the root cause of the entry issues when the recalculation setting is enabled, ensuring consistent logic and behavior.
2. **Accurate Entries & Exits**: I'll modify the strategy to strictly adhere to the condition where the 20 EMA > 50 EMA, entering a position on *every* qualifying candle. Positions will accurately reflect TP/SL hits within the same candle.
3. **Efficiency & Reliability**: I'll implement safeguards to prevent irregular entry behavior, ensuring TradingView handles your logic correctly, even with recalculation settings.
4. **Testing & Validation**: The modified strategy will be rigorously tested to confirm it behaves as intended across different scenarios.
**Delivery**: Within 2–3 business days.
Your satisfaction is my priority. I specialize in creating reliable and efficient Pine Script strategies, and I’ll ensure this aligns perfectly with your requirements.
Let me know if you'd like to proceed or if there's any other detail you'd like to add!
Best regards,
Houssame
Hi there,
★★★ Pine Script / TradingView Expert ★★★ 7+ Years of Experience ★★★
I've read requirements and ready to work on your project.
I'm a full time pine script coder who completed more then 300 projects with flawless customer satisfaction. My main goal is good communication, instant support, fast delivery and perfect quality.
List of my services:
✔️ Create a custom study script (indicator)
✔️ Create a custom strategy script (will have backtest option)
✔️ Make a study-to-strategy conversion
✔️ Combine several indicators into one script code
✔️ Add alert functionality for your existing indicator
✔️ Create strategies compatible with auto trade services such as 3Commas, Cryptohopper, AutoView or PineConnector
✔️ Pine script code version updates
As the requirements on project are not complete and need discussion so i placed tentative bid. To provide you the best quote, let's have a chat!
Best Regards,
TechPlus Team
I can assist you to modify your pine script according to your requirements. I have 14 years of experience in the field and i can handle it properly. Lets discuss more to move forward.
I will develop a custom MT4 indicator that leverages your existing Color Histogram data to draw Support and Resistance lines, as well as Up/Down arrows when these lines are breached. The indicator will include customizable options for arrow and line styles, a break points filter, and visual toggles. I’ll ensure clean and efficient code, provide buffers for trend arrows, and deliver the source code upon project completion, adhering to your specifications.
I can help you enhance your TradingView strategy. I will modify the code to ensure that the "Recalculate on Order Fills" parameter functions correctly, preventing multiple entries within the same candle. I will focus on accurate signal generation and ensure the strategy operates as intended. I have experience in developing and optimizing Pine Script strategies and can deliver a well-documented and efficient solution.