Skip to content

Find Method (5)

Find (1 of 5)

Summary

Find a position by its label.

Signature

1
public abstract Position Find(string label)

Parameters

Name Type Description
label string Label to search by

Return Value

Position

Declaring Type

cAlgo.API.Positions

Examples

1
 int totalPositions = Positions.Count;
1
 Position position =  Positions.Find("myLabel", Symbol, TradeType.Buy);
1
 Position[] positions = Positions.FindAll("myLabel", Symbol, TradeType.Buy);
1
 Positions.Opened += PositionsOnOpened;

Find (2 of 5)

Summary

Find a position by its label and symbol name.

Signature

1
public abstract Position Find(string label, string symbolName)

Parameters

Name Type Description
label string Label to search by
symbolName string Symbol name to search by

Return Value

Position

Declaring Type

cAlgo.API.Positions

Examples

1
 int totalPositions = Positions.Count;
1
 Position position =  Positions.Find("myLabel", Symbol, TradeType.Buy);
1
 Position[] positions = Positions.FindAll("myLabel", Symbol, TradeType.Buy);
1
 Positions.Opened += PositionsOnOpened;

Find (3 of 5)

Summary

Find a position by its label, symbol name and trade type

Signature

1
public abstract Position Find(string label, string symbolName, TradeType tradeType)

Parameters

Name Type Description
label string Label to search by
symbolName string Symbol name to search by
tradeType TradeType Trade type to search by

Return Value

Position

Declaring Type

cAlgo.API.Positions

Examples

1
 int totalPositions = Positions.Count;
1
 Position position =  Positions.Find("myLabel", Symbol, TradeType.Buy);
1
 Position[] positions = Positions.FindAll("myLabel", Symbol, TradeType.Buy);
1
 Positions.Opened += PositionsOnOpened;

Find (4 of 5)

Summary

Find all positions with this label.

Signature

1
public abstract Position Find(string label, Symbol symbol)

Parameters

Name Type Description
label string Label to search by
symbol Symbol

Return Value

Position

Declaring Type

cAlgo.API.Positions

Examples

1
 int totalPositions = Positions.Count;
1
 Position position =  Positions.Find("myLabel", Symbol, TradeType.Buy);
1
 Position[] positions = Positions.FindAll("myLabel", Symbol, TradeType.Buy);
1
 Positions.Opened += PositionsOnOpened;

Find (5 of 5)

Summary

Find all positions with this label and symbol name.

Signature

1
public abstract Position Find(string label, Symbol symbol, TradeType tradeType)

Parameters

Name Type Description
label string Label to search by
symbol Symbol
tradeType TradeType

Return Value

Position

Declaring Type

cAlgo.API.Positions

Examples

1
 int totalPositions = Positions.Count;
1
 Position position =  Positions.Find("myLabel", Symbol, TradeType.Buy);
1
 Position[] positions = Positions.FindAll("myLabel", Symbol, TradeType.Buy);
1
 Positions.Opened += PositionsOnOpened;

Last update: November 25, 2022

Comments