Login Page - Create Account

Support Board


Date/Time: Tue, 04 Mar 2025 16:07:39 +0000



[Programming Help] - using calculated ATR in my system

View Count: 782

[2021-12-10 11:38:28]
User61576 - Posts: 445
I am calculating my ATR using
float atr_bars = sc.ATR(sc.BaseDataIn, Subgraph_ATR, ATR_Length.GetInt(), MOVAVGTYPE_SIMPLE);

and calculating my target price order based on this:
target1Price = mktPrice - (tPriceInput.GetInt() * sc.TickSize * atr_bars);

but when building (remote) i get this error:
error: cannot convert 'c_ArrayWrapper<float>' to 'float' in initialization

I hope someone could help as I am new to this
thanks
[2021-12-14 17:44:44]
User61576 - Posts: 445
anyone can help?
[2021-12-14 17:52:19]
User99735 - Posts: 234
ACSIL Interface Members - Functions: sc.ATR() follow the example given here

sc.ATR does not return the current ATR value. The same needs to be accessed via float array Subgraph_ATR in your call to sc.ATR function.

To post a message in this thread, you need to log in with your Sierra Chart account:

Login

Login Page - Create Account