func (m *Trade) MarshalBinary() ([]byte, error) {
	if m == nil {
		return nil, nil
	}
	return swag.WriteJSON(m)
}
MarshalBinary interface implementation
package models
import (
	strfmt "github.com/go-openapi/strfmt"
	"github.com/go-openapi/errors"
	"github.com/go-openapi/swag"
	"github.com/go-openapi/validate"
)
type Trade struct {
	Label *string `json:"label"`
	MatchingID *int64 `json:"matchingId"`
	Price *float64 `json:"price"`
	Quantity *int64 `json:"quantity"`
	SelfTrade *bool `json:"selfTrade"`
	TradeSeq *int64 `json:"tradeSeq"`
}
func (m *Trade) Validate(formats strfmt.Registry) error {
	var res []error
	if err := m.validateLabel(formats); err != nil {
		res = append(res, err)
	}
	if err := m.validateMatchingID(formats); err != nil {
		res = append(res, err)
	}
	if err := m.validatePrice(formats); err != nil {
		res = append(res, err)
	}
	if err := m.validateQuantity(formats); err != nil {
		res = append(res, err)
	}
	if err := m.validateSelfTrade(formats); err != nil {
		res = append(res, err)
	}
	if err := m.validateTradeSeq(formats); err != nil {
		res = append(res, err)
	}
	if len(res) > 0 {
		return errors.CompositeValidationError(res...)
	}
	return nil
}
func (m *Trade) validateLabel(formats strfmt.Registry) error {
	if err := validate.Required("label", "body", m.Label); err != nil {
		return err
	}
	return nil
}
func (m *Trade) validateMatchingID(formats strfmt.Registry) error {
	if err := validate.Required("matchingId", "body", m.MatchingID); err != nil {
		return err
	}
	return nil
}
func (m *Trade) validatePrice(formats strfmt.Registry) error {
	if err := validate.Required("price", "body", m.Price); err != nil {
		return err
	}
	return nil
}
func (m *Trade) validateQuantity(formats strfmt.Registry) error {
	if err := validate.Required("quantity", "body", m.Quantity); err != nil {
		return err
	}
	return nil
}
func (m *Trade) validateSelfTrade(formats strfmt.Registry) error {
	if err := validate.Required("selfTrade", "body", m.SelfTrade); err != nil {
		return err
	}
	return nil
}
func (m *Trade) validateTradeSeq(formats strfmt.Registry) error {
	if err := validate.Required("tradeSeq", "body", m.TradeSeq); err != nil {
		return err
	}
	return nil
}