Create TradingView indicator that plots an EMA based on ATR

Përfunduar Postuar 1 vit mё parё Paguhet në dorëzim
Përfunduar Paguhet në dorëzim

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 Projekti: #36172309

Rreth projektit

7 propozimet Projekti në distancë Aktiv 1 vit mё parё

Është zgjedhur fitues:

(62 Përshtypje)
6.0

7 profesionistë freelancer dërguan një ofertë mesatare prej $30 për këtë punë

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 Më shumë

$30 USD për 7 ditë
(41 Përshtypje)
5.9
Milvetti

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

$30 USD për 1 ditë
(10 Përshtypje)
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 për 7 ditë
(5 Përshtypje)
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 Më shumë

$20 USD për 7 ditë
(0 Përshtypje)
0.0