Output variable from an indicator to a bot
Created at 20 May 2017, 19:45
Output variable from an indicator to a bot
20 May 2017, 19:45
Hello,
I am assigning a variable value to a public data series index within an indicator and output it.
It is printing out the value from the indicator, but from the bot it is printing out NaN.
The indicator is initialized correctly.
Please advise.
Replies
... Deleted by UFO ...
croucrou
24 May 2017, 14:36
Here is how I do that:
Indicator:
namespace cAlgo { [Indicator(IsOverlay = false, TimeZone = TimeZones.UTC, AccessRights = AccessRights.None)] public class tl : Indicator { [Output("Result")] public IndicatorDataSeries Result { get; set; } public override void Calculate(int index) { Result[index] = variable; Print(Result[index]); //Printing variable value correctly Print(Result[0]); //Printing NaN //alternatively: Result[0] = variable; Print(Result[0]); //Printing variable value correctly } } }
Bot:
Please help.
@croucrou