Skip to content

TradeType

Summary

The direction of a trade order.

Remarks

Indicates the trade direction, whether it is a Buy or a Sell trade.

Signature

1
public enum TradeType

Namespace

cAlgo.API

Fields

Name Description
Buy Represents a Buy order.
Sell Represents a Sell order.

Examples

1
 ExecuteMarketOrder(TradeType.Buy, Symbol, 20000);
1
 Position position =  Positions.Find("myLabel", Symbol, TradeType.Sell);
1
 PlaceLimitOrder(TradeType.Buy, Symbol, 10000, Symbol.Bid);
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
 using cAlgo.API;
 namespace cAlgo.Robots
 {
     // This sample cBot shows how to use the TradeType
     // TradeType is used to set an order trade side or direction
     [Robot(TimeZone = TimeZones.UTC, AccessRights = AccessRights.None)]
     public class TradeTypeSample : Robot
     {
         [Parameter("Trade Type", DefaultValue = TradeType.Buy)]
         public TradeType TradeType { get; set; }
         protected override void OnStart()
         {
             ExecuteMarketOrder(TradeType, SymbolName, Symbol.VolumeInUnitsMin);
         }
     }
 }

Last update: March 23, 2023