Find Jobs
Hire Freelancers

Fix pine script code where I need to compare previous two prices with actual price

€8-30 EUR

Completed
Posted 5 months ago

€8-30 EUR

Paid on delivery
I need to fix my code where I want compare two previous open prices with specific condition and actual open price candle with same condition. I am showing only part of the code which is not working. All variables are set correctly but I am not able to get open price information for xxOpen1 and xxOpen2 and then plot in label. I am getting study error. Compiling is without any error but overall study is not working on chart. Here is my code: openHistory = [login to view URL]([login to view URL], "15S", open, lookahead=barmerge.lookahead_on) for i = 0 to 30 wt101Condition = wt101[i] > wt201[i] and wtDot[i] == 1 and (wt102[i] < 0 or wt202[i] < 0) if (wt101Condition) // Calculate historical xxPrice, xxOpen1, and xxOpen2 using an offset xxPrice := open[i] xxWT101 := wt101[i] xxWT201 := wt201[i] // Extract historical open prices using array indexing xxOpen1 := openHistory[i - 1] xxOpen2 := openHistory[i - 2] // Set the flag to color the next XX shouldColorNextXX := true // Create or update the label for each bar if ([login to view URL](xxLabels) <= i) [login to view URL](xxLabels, [login to view URL](x=bar_index - i, y=xxPrice, text="XPrice: " + [login to view URL](xxPrice) + " Open1: " + [login to view URL](xxOpen1) + " Open2: " + [login to view URL](xxOpen2) + " WAVE" + [login to view URL](xxWT101) + " WAVE" + [login to view URL](xxWT201), style=label.style_label_lower_left, color=[login to view URL], textcolor=[login to view URL], size=[login to view URL])) else label.set_xy([login to view URL](xxLabels, i), x=bar_index - i, y=xxPrice) label.set_text([login to view URL](xxLabels, i), "XPrice: " + [login to view URL](xxPrice) + " Open1: " + [login to view URL](xxOpen1) + " Open2: " + [login to view URL](xxOpen2) + " WAVE" + [login to view URL](xxWT101) + " WAVE" + [login to view URL](xxWT201))
Project ID: 37600078

About the project

6 proposals
Remote project
Active 5 mos ago

Looking to make some money?

Benefits of bidding on Freelancer

Set your budget and timeframe
Get paid for your work
Outline your proposal
It's free to sign up and bid on jobs
Awarded to:
User Avatar
Hi, am pinescript specialist, and i found where is the error, if u award me, i can finish it in few hours, thanks
€30 EUR in 1 day
5.0 (35 reviews)
5.5
5.5
6 freelancers are bidding on average €33 EUR for this job
User Avatar
Please check my past work, coding ability and reviews on my portfolio. I offer a range of Pine Script services: Creating Custom Indicators Debugging Pine Script Code Combining Existing Indicators Updating Existing Indicators Generating Trading Signals Creating Custom Alerts Building Custom Screeners Plotting Custom Visualization Developing Backtesting Systems Implementing Risk Management Creating Trading Systems
€50 EUR in 1 day
5.0 (87 reviews)
6.7
6.7
User Avatar
Hi. I already did similar projects to this job successfully. I am a professional coder in the development of EAs, Indicators and Scripts for MT4/MT5 and TradingView. Please let us talk about the details of the job, so that we can do this job as you expect.
€30 EUR in 1 day
5.0 (40 reviews)
5.2
5.2
User Avatar
Hey, As a professional trader and a Pinescript developer with more than 5 years of experience, this project seems straightforward for me and I can complete it within a few minutes. Please reach out to discuss further. Sincerely, BAGGAR Nassim
€30 EUR in 1 day
5.0 (7 reviews)
3.7
3.7
User Avatar
Hello Client , i am a professional programmer for financial markets. I have over 10 years experienced, Tradingview platforms, so I’m sure I can modify your code and i have coded similar before .lets discuss more.
€25 EUR in 1 day
0.0 (2 reviews)
1.2
1.2
User Avatar
Hello there, the problem in your script is that "openHistory[i - 1]" and "openHistory[i - 2]" result in negative indices "openHistory[-1]" and "openHistory[-2]" because your loop starts from 0, which PineScript doesn't allow. If you still need a freelancer for the job, I would be happy to discuss further details over the chat.
€30 EUR in 2 days
0.0 (0 reviews)
0.0
0.0

About the client

Flag of SLOVAKIA
Nitra-Dolné Krškany, Slovakia
5.0
22
Payment method verified
Member since Sep 10, 2018

Client Verification

Thanks! We’ve emailed you a link to claim your free credit.
Something went wrong while sending your email. Please try again.
Registered Users Total Jobs Posted
Freelancer ® is a registered Trademark of Freelancer Technology Pty Limited (ACN 142 189 759)
Copyright © 2024 Freelancer Technology Pty Limited (ACN 142 189 759)
Loading preview
Permission granted for Geolocation.
Your login session has expired and you have been logged out. Please log in again.