NEWMARGIN

Top  Previous  Next

Keyword Description

Required margin

Class

Function

Where Legal

Resources

Entry Logic

Exit Logic

Initial Size

Resize

(Pre-Category)

Resize

(Category-Level)

 

 

 

l

 

 

Syntax

NEWMARGIN

 

Return Value

Returns the dollar amount of required margin for the trade being presented. This value is user specified in Symbol Manager.

Example

Sample code

IF NEWMARGIN + TOTALMARGIN > TOTALEQUITY * .85 THEN_

NEWCONTRACTS = 0  ELSE...

' This fragment tells Mechanica not to accept a new trade if

' doing so would put margin requirements over 85% of equity.

 

MEMORY[1] = (TOTALEQUITY * .50 - TOTALMARGIN ) / NEWMARGIN

' This tells Mechanica to save in MEMORY[1] the number of 

' contracts or lots to trade if you wished to never margin

' more than 50% of your equity.

IF NEWMARGIN > SECTORMARGIN * .2 THEN NEWCONTRACTS = ...

 

ThumbTack white

This is a position sizing tool used to allow your system to access the margin (in dollars) required by a trade when it is presented.  It can be used to limit the number of contracts or lots to a pre-defined threshold.

 

See also:

TOTALMARGIN