enterLong (function, var v0, ...): TRADE*

enterShort (function, var v0, ... ): TRADE*

Enters a long resp. short trade position.

Parameters:

function Optional pointer of an int function for managing the trade. The function is called every tick with the TRADE* pointer as first argument, followed by further numbers or variables. It can react on price changes for closing the position or adjusting stop and profit limits. The function normally returns 0. A return value of 1 exits the trade. A return value of -1 causes the Stop, Profit, and Trail parameters to be ignored and leaves stop management completely to the trade function.
v0, ... Optional variables that are passed as further arguments to the trade function.

Returns:

TRADE* - a pointer to the created trade struct. See include\trading.h for the definition of trading specific structs.

Remarks:

Example:

Algo = "WMA";
if(crossUnder(seriesTrigger,seriesWMA))
enterShort();

See also:

exitTrade, exitLong, exitShort, numLong, numShort, Lots, Risk, Entry, Stop

► latest version online