NeedForTrade Documentation

Sell Methods

Sell method names are constructed as follows:

Sell<When><Price>[<ExitOptions>]([<Parameters>])

 

<ExitOptions> and <Parameters> are optional and may vary depending on your needs.

 

For example:

SellNextBarAtMarket();

Available When variants:

 

Available Price variants:

 

Tip: relativePrice can be negative to specify price less then Open price of the next bar.

 

Available ExitOptions variants:

 

Tip: use FromEntry exit option to to close specific entries named with tradeName parameter.

 

Backtesting Real Time Strategies on historical data:

 

List of available Sell methods with possible parameters:

 

// BackTestSell
    void BackTestSell(double price);
    void BackTestSell(double price, int tradeSize);
    void BackTestSell(string tradeName, double price);
    void BackTestSell(string tradeName, double price, int tradeSize);
    void BackTestSellFromEntry(string tradeName, double price, int tradeSize);
    void BackTestSellFromEntryTotal(string tradeName, double price, int tradeSize);
    void BackTestSellTotal(double price, int tradeSize);
    void BackTestSellTotal(string tradeName, double price, int tradeSize);
    
// SellAtLimit
    void SellAtLimit(double limitPrice);
    void SellAtLimit(double limitPrice, int tradeSize);
    void SellAtLimit(string tradeName, double limitPrice);
    void SellAtLimit(string tradeName, double limitPrice, int tradeSize);
    void SellAtLimitFromEntry(string tradeName, double limitPrice, int tradeSize);
    void SellAtLimitFromEntryTotal(string tradeName, double limitPrice, int tradeSize);
    void SellAtLimitTotal(double limitPrice, int tradeSize);
    void SellAtLimitTotal(string tradeName, double limitPrice, int tradeSize);

// SellAtMarket
    void SellAtMarket();
    void SellAtMarket(int tradeSize);
    void SellAtMarket(string tradeName);
    void SellAtMarket(string tradeName, int tradeSize);
    void SellAtMarketFromEntry(string tradeName, int tradeSize);
    void SellAtMarketFromEntryTotal(string tradeName, int tradeSize);
    void SellAtMarketTotal(int tradeSize);
    void SellAtMarketTotal(string tradeName, int tradeSize);

// SellAtStop
    void SellAtStop(double stopPrice);
    void SellAtStop(double stopPrice, int tradeSize);
    void SellAtStop(string tradeName, double stopPrice);
    void SellAtStop(string tradeName, double stopPrice, int tradeSize);
    void SellAtStopFromEntry(string tradeName, double stopPrice, int tradeSize);
    void SellAtStopFromEntryTotal(string tradeName, double stopPrice, int tradeSize);
    void SellAtStopTotal(double stopPrice, int tradeSize);
    void SellAtStopTotal(string tradeName, double stopPrice, int tradeSize);