Create TradingView indicator that plots an EMA based on ATR

已完成 已发布的 1 年前 货到付款
已完成 货到付款

This should be a real quick and easy job if you know Pinescript. I think it just needs a custom EMA function.

I want to use the value of the current ATR as the length of an EMA. Since ATR is a float, I used int() to convert to integer. But it needs to be a "simple int". How do I do that?

Here is the code to modify.

//@version=5

indicator(title="EMA + ATR", shorttitle="EMA + ATR", overlay=true, timeframe="", timeframe_gaps=true)

i_ATRlength = [login to view URL](10, minval=1, title="Length")

i_Source = input(close, title="Source")

ATRcalc = [login to view URL](i_ATRlength)

ATRint = int(ATRcalc)

EMAcalc = [login to view URL](i_Source, ATRint)

plot(EMAcalc, title="EMA", color=[login to view URL])

I can make it look nicer and I'll be adding more to it, but I need to get this base working first.

Thanks!

Pine Script Python

项目ID: #36172309

关于项目

7个方案 远程项目 活跃的1 年前

授予:

(62条评论)
6.0

有7名威客正在参与此工作的竞标,均价$30/小时

ARrowofTime

Please check my portfolio I can do: Indicator/strategy Backtesting: Spot, margin, combined spot and margin, leverage, liquidation, partial order… Visualization Alerts Multiple indicators in one indicator Make ch 更多

$30 USD 在7天内
(41条评论)
5.9
Milvetti

Hello, I hope you are well. I can deliver within 1 hour. Please contact me for details. Have a nice day

$30USD 在1天里
(10条评论)
3.6
ahmedabdulhamza

Hi I can help you to To convert the float value of ATR to a "simple int", you can use the round() function in Pine Script. The round() function rounds a floating-point number to the nearest integer.

$20 USD 在7天内
(5条评论)
1.8
Sabahat516

I believe I am the best candidate for this job as I have experience in coding and am proficient in Pinescript. I have a solid understanding of data types and conversions, and can easily create custom functions to suit 更多

$20 USD 在7天内
(0条评论)
0.0