Bot Class

Main class for inheritance

Definition

Namespace: SharpTraderBot
Assembly: SharpTraderBot (in SharpTraderBot.dll) Version: 1.0.0
C#
public class Bot
Inheritance
Object    Bot

Properties

closedPositions List that contains all positions closed by the bot
openedPositions List that contains all current positions opened by the bot
pendingOrders List that contains all current pending orders opened by the bot

Methods

cancelOrder Cancels the order on session specified
cancelOrderByID Cancels the order by order id on session specified
cancelOrderByIndex Cancels the order with provided index
closePosition Closes the position specified
closePositionByComment Closes the position with comment specified
closePositionByID Closes the position with ID specified
closePositionByIndex Closes the position with index specified
getLastError Returns last error raised during the bot execution
getPositionByComment Returns position with comment specified
getPositionByID Returns position with comment specified
getPositionBySymbol Returns position with comment specified
modifyPositionByComment Modifies stops of position with specified comment
modifyPositionByID Modifies stops of position with specified id
modifyPositionByIndex Modifies stops of position with specified index
OnDeinit Put the bot deinitialization logic here
OnInit Put the bot initialization logic here
OnOrderStatusUpdate Called when order status was changed on any of assosiated sessions
OnPositionClosed Called when position is closed on any of assosiated sessions
OnPositionOpened Called when new position is opened on any of assosiated sessions
OnTick Called on tick from any of assosiated sessions
sendOrder(Int32, STOrder) Sends the order to session specified
sendOrder(Int32, String, Double, OrderSide, OrderType, Double, String) Sends the order with set of parameters to session specified
stopBot Call this method when you want to stop bot execution
writeLog Call this method when you want to write information to the strategy log

Fields

indicators Interface that provides indicators functionality
ticker Interface that provides account and symbol information

See Also