AnotherBrian Posted July 11, 2020 Report Share Posted July 11, 2020 I can code in some languages but C# isn't my thing. (I can do AFL and MT4 no problem) In the code I want to determine the chart frequency that the indicator is loaded on, so I can change the period of the SMA in the code. This is for paintbars and scans. I just don;t know how to get that variable. I think I need to study up on C# basics. Quote Link to comment Share on other sites More sharing options...
Mike Medved Posted July 11, 2020 Report Share Posted July 11, 2020 Hm. I didn't consider that. One way would be to take the Timestamp of the candle and subtract the Timestamp of the previous candle. The problem with that approach is that sometimes for thinly traded stocks and for pre/afterhours there are no candles for some minutes, and at the beginning of the day the difference between the timestamp of the first candle of the day and the last candle of the previous day is obviously huge. I will provide a system variable for the frequency. Will post here when done. Quote Link to comment Share on other sites More sharing options...
Mike Medved Posted July 11, 2020 Report Share Posted July 11, 2020 There will be an int32 system variable CandleSizeInSec - for 1 min candles it would be 60, 2 min - 120 etc. It can be used both in Simple and Advanced modes. This would ONLY work for intraday charts' candles - and only for time-based charts if in paintbar. Will be out in next beta. Quote Link to comment Share on other sites More sharing options...
AnotherBrian Posted July 12, 2020 Author Report Share Posted July 12, 2020 Hi Mike; Thanks for this new variable. Being available in simple mode is super too. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.