Is locking allowed? What margin applies when locking positions?

Yes, locking is allowed. When the volume of locked positions for one instrument is equal — no margin applies.
site call