Hi all,
Is there any example how to create a contract with user specified lot size and assign to
SOrderParameters?
Thank you in advanced!
William
How to code user specific lot size [SOLVED]
- JoshM
- Posts: 2195
- Joined: 20 May 2011
- Location: The Netherlands
- Has thanked: 1544 times
- Been thanked: 1565 times
- Contact:
Re: How to code user specific lot size
I don't know if the specified lot size can be assigned to SOrderParameters, but you can define there Contracts.UserSpecified, and then specify your order size when you submit an order in the CalcBar() method.Is there any example how to create a contract with user specified lot size and assign to SOrderParameters?
For example:
Code: Select all
namespace PowerLanguage.Strategy
{
public class TestStrategy : SignalObject
{
private IOrderMarket buy_order;
protected override void Create()
{
buy_order = OrderCreator.MarketNextBar(new SOrderParameters(Contracts.UserSpecified, "MACrossLE", EOrderAction.Buy));
}
protected override void CalcBar()
{
if (enterLong == true)
{
buy_order.Send(int numLots);
}
}
}
}