retesere20

----recycler---difference type indi strat nt8

Sep 11th, 2018
54
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. In my strategy I use XYZ(this)
  2.  
  3. method XYZ(NinjaTrader.NinjaScript.NinjaScriptBase myObj) if method comes from DLL if method comes from open-source .cs addon
  4. {
  5.  
  6. myObj.Print(myObj.GetType().ToString() ); NinjaTrader.NinjaScript.Strategies.LJ.ThreeBars NinjaTrader.NinjaScript.Strategies.LJ.ThreeBars
  7. myObj.Print(myObj is NinjaTrader.NinjaScript.Strategies.Strategy ); FALSE TRUE
  8. myObj.Print(myObj is NinjaTrader.NinjaScript.StrategyBase); TRUE TRUE
  9.  
  10. myObj.Print(myObj.GetType().IsSubclassOf( typeof(NinjaTrader.NinjaScript.Strategies.Strategy) ) ); FALSE TRUE
  11. myObj.Print(myObj.GetType().IsSubclassOf( typeof(NinjaTrader.NinjaScript.StrategyBase) ) ); TRUE TRUE
  12.  
  13. myObj.Print(myObj.GetType() is NinjaTrader.NinjaScript.Strategies.Strategy ); FALSE FALSE
  14. myObj.Print(myObj.GetType() is NinjaTrader.NinjaScript.StrategyBase ); FALSE FALSE
  15. }
RAW Paste Data