Advertisement
Guest User

Untitled

a guest
Mar 10th, 2022
61
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.62 KB | None | 0 0
  1. GetCurrentFuture("CL");
  2.  
  3.  
  4. private string GetCurrentFuture(string name)
  5. {
  6.     foreach (Instrument inst in Instrument.All)
  7.     {
  8.         if (inst.MasterInstrument.Name == name && inst.MasterInstrument.InstrumentType == InstrumentType.Future)
  9.         {
  10.             string instFullName = String.Format("{0} {1}-{2}",
  11.                             name,
  12.                             inst.MasterInstrument.GetNextExpiry(Core.Globals.Now).Month.ToString("D2"),
  13.                             inst.MasterInstrument.GetNextExpiry(Core.Globals.Now).ToString("yy"));
  14.  
  15.             return instFullName;
  16.         }
  17.     }
  18.     return name;
  19. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement