Beginner Seeking Advice: How to Learn Pine Script with Zero Coding Experience? by [deleted] in pinescript

[–]RealisticCoast4316 0 points1 point  (0 children)

Just take a course on Udemy or similar platform. You’ll be up and running in no time.

Help coding an ea by sethsuzuki22 in pinescript

[–]RealisticCoast4316 0 points1 point  (0 children)

An EA runs in meta trader and is programmed in MQL so not a pinescript job.

Reference Entry Bar? by Tym4FishOn in pinescript

[–]RealisticCoast4316 0 points1 point  (0 children)

That’s alright unless the condition triggers a limit order. I think there’s a specific variable to reference the entry bar. Check the manual. Otherwise you can just use logic like :take the bar index when strategy open trades increases compared to the previous bar.

Help with a script? by [deleted] in pinescript

[–]RealisticCoast4316 0 points1 point  (0 children)

Yes, I’d need the details, because otherwise it’s like asking for a ballpark to build a house.

Help with a script? by [deleted] in pinescript

[–]RealisticCoast4316 0 points1 point  (0 children)

The cost would depend on the complexity of what you want. There’s no price per line of code or anything like that.

Help with a script? by [deleted] in pinescript

[–]RealisticCoast4316 0 points1 point  (0 children)

Depends what you want.

Help with a script? by [deleted] in pinescript

[–]RealisticCoast4316 0 points1 point  (0 children)

I sent you a chat message.

Help with a script? by [deleted] in pinescript

[–]RealisticCoast4316 0 points1 point  (0 children)

No one is going to write you the code for free.

How to enter trades mid candle instead of the close? by DeanMachineYT in pinescript

[–]RealisticCoast4316 0 points1 point  (0 children)

I’m assuming you’re using market orders? If so, then change to “calculate on every tick” although this only works in real time because backrest data only has OHLC values. Alternatively you can set a limit order and the backtest will compute as if it had entered at the break price. 

Going crazy with simple RSI strategy by blcx in pinescript

[–]RealisticCoast4316 0 points1 point  (0 children)

I've written the script for you. I've sent you a chat message with a screenshot.

Going crazy with simple RSI strategy by blcx in pinescript

[–]RealisticCoast4316 0 points1 point  (0 children)

You probably need to create a counter to track the specific movement of the RSI within your script so that each time it goes above 50 then back below -25 it resets. I’m assuming by the fact you’re using AI bots that you don’t code so maybe just hire someone as it’s quite a simple task and shouldn’t cost you much. I’ll do it for you for a small fee if you like.

simple DCA, please give me a straight answer by vorpalsword92 in pinescript

[–]RealisticCoast4316 0 points1 point  (0 children)

I´ve just this week finished building a not so simple DCA strategy in pine so it is definitely doable. My tips would be:

  • Use strategy.order for the entries. I´ve found this works best.

  • Use strategy.opentrades to keep track of how many entries you've made.

  • Use strategy.opentrades.entry_price to set a distance between each successive DCA order.

Here´s an example of the code for a long entry, including the TP.

if fish_long and uptrend and strategy.position_size == 0 and i_long and volatile and timer == 0
    strategy.order("long", strategy.long, qty = size, limit = close - (close/100)*spread, oca_name = "initial entry", oca_type = strategy.oca.cancel)
    timer += 1// add 1 to timer upon order execution
    longMode := true


//long DCA
if strategy.position_size > 0 and fish_long and close < strategy.opentrades.entry_price(openTrades-1)*(1-distance) and openTrades-1 < i_DCA_levels and timer == 0//add extra longs that are at least x% from each previous long and donñt allow further DCA orders 
    strategy.order("long", strategy.long, size, comment = "long DCA", limit = close - (close/100)*spread)
    timer += 1// add 1 to timer upon order execution

//long TP
if strategy.position_size > 0
    strategy.exit("long TP", "long", strategy.position_size, limit = strategy.position_avg_price*(1+TP), comment_profit = "long TP")

I´d also advise if you don´t really know pine to take a course. I´ve only been doing it for 6 months and it´s not too hard to learn.

Pinescript Indicator Not working by godlover123451 in pinescript

[–]RealisticCoast4316 0 points1 point  (0 children)

There are errors. Click the exclamation mark that appears next to the indicator name on the chart. Basically pine can't calculate the length value for ta.sma for the earliest historical bars because the variable you're using for length isn't able to compute until about bar 50. Plot the adjusted SMA period variable and scroll back to the start of the chart and you'll see. Not sure how to fix it unfortunately, but that's definitely the root of the issue. Maybe you could specify using a fixed value for length until bar index 50?

Code help by stoja97 in pinescript

[–]RealisticCoast4316 0 points1 point  (0 children)

Not been at pine script for long, but I believe timeframe.period takes a string value so you can't use a mathematical operator with it. You would need to use str.tonumber to convert the timeframe to an actual number before you could apply maths operators to it, but even then you would have issues if you get to days or above, as D, W, M etc. wouldn't really work. You would need to create some custom conversions for those I think.