Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ############################ CODE ############################
- using NinjaTrader.Cbi;
- using NinjaTrader.Data;
- namespace NinjaTrader.NinjaScript.Indicators{
- public partial class example_MTF_print : Indicator{
- protected override void OnStateChange(){
- if (State == State.SetDefaults){ Name = "example_MTF_print"; Calculate = Calculate.OnEachTick; }
- else if (State == State.Configure) { AddDataSeries(Instrument.FullName, BarsPeriodType.Minute, 1, MarketDataType.Last); }
- }
- protected override void OnBarUpdate(){
- Print(State.ToString() +" | "+ BarsInProgress +" | "+CurrentBars[0] +" | "+Close[0] +" | "+Time[0]);
- }
- }
- }
- ############################ OUTPUT ############################
- ...
- Historical | 1 | 202 | 2826.5 | 27-Mar-19 05:08:00
- Historical | 1 | 202 | 2826.25 | 27-Mar-19 05:09:00
- Historical | 0 | 203 | 2826.25 | 27-Mar-19 05:10:00
- Historical | 1 | 203 | 2826.25 | 27-Mar-19 05:10:00
- Historical | 1 | 203 | 2826.5 | 27-Mar-19 05:11:00
- Historical | 1 | 203 | 2826.75 | 27-Mar-19 05:12:00
- Historical | 1 | 203 | 2827 | 27-Mar-19 05:13:00
- Historical | 1 | 203 | 2827 | 27-Mar-19 05:14:00
- Historical | 1 | 203 | 2827.5 | 27-Mar-19 05:15:00
- Historical | 1 | 203 | 2827 | 27-Mar-19 05:16:00
- Historical | 1 | 203 | 2827.25 | 27-Mar-19 05:17:00
- Historical | 1 | 203 | 2827 | 27-Mar-19 05:18:00
- Historical | 1 | 203 | 2826.5 | 27-Mar-19 05:19:00
- Historical | 0 | 204 | 2826.5 | 27-Mar-19 05:20:00
- Historical | 1 | 204 | 2826.5 | 27-Mar-19 05:20:00
- ...
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement