retesere20

example-nt8-mtf-REALTIME-VS-HISTORICAL

Mar 27th, 2019
99
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. ############################ CODE ############################
  2.  
  3. using NinjaTrader.Cbi;
  4. using NinjaTrader.Data;
  5. namespace NinjaTrader.NinjaScript.Indicators{
  6. public partial class example_MTF_print : Indicator{
  7. protected override void OnStateChange(){
  8. if (State == State.SetDefaults){ Name = "example_MTF_print"; Calculate = Calculate.OnEachTick; }
  9. else if (State == State.Configure) { AddDataSeries(Instrument.FullName, BarsPeriodType.Minute, 1, MarketDataType.Last); }
  10. }
  11.  
  12. protected override void OnBarUpdate(){
  13. Print(State.ToString() +" | "+ BarsInProgress +" | "+CurrentBars[0] +" | "+Close[0] +" | "+Time[0]);
  14. }
  15. }
  16. }
  17.  
  18.  
  19.  
  20.  
  21. ############################ OUTPUT ############################
  22. ...
  23. Historical | 1 | 202 | 2826.5 | 27-Mar-19 05:08:00
  24. Historical | 1 | 202 | 2826.25 | 27-Mar-19 05:09:00
  25. Historical | 0 | 203 | 2826.25 | 27-Mar-19 05:10:00
  26. Historical | 1 | 203 | 2826.25 | 27-Mar-19 05:10:00
  27. Historical | 1 | 203 | 2826.5 | 27-Mar-19 05:11:00
  28. Historical | 1 | 203 | 2826.75 | 27-Mar-19 05:12:00
  29. Historical | 1 | 203 | 2827 | 27-Mar-19 05:13:00
  30. Historical | 1 | 203 | 2827 | 27-Mar-19 05:14:00
  31. Historical | 1 | 203 | 2827.5 | 27-Mar-19 05:15:00
  32. Historical | 1 | 203 | 2827 | 27-Mar-19 05:16:00
  33. Historical | 1 | 203 | 2827.25 | 27-Mar-19 05:17:00
  34. Historical | 1 | 203 | 2827 | 27-Mar-19 05:18:00
  35. Historical | 1 | 203 | 2826.5 | 27-Mar-19 05:19:00
  36. Historical | 0 | 204 | 2826.5 | 27-Mar-19 05:20:00
  37. Historical | 1 | 204 | 2826.5 | 27-Mar-19 05:20:00
  38. ...
RAW Paste Data