Positions.Find Return Null after the first couple of calls
Positions.Find Return Null after the first couple of calls
03 May 2017, 10:26
I have a simple algo that I am working on at the moment where a call is made to open or close a position and righ at the start 2 variables are set up containing a buy or Sell position.
If a buy position is open and a opposite signal is received the position should close and vice versa
The problem is after the first couple of call the Positions.Find method is returning null even though there is a position open.
So to be clear at the start it is populating my variables with the open positions and then stops.
When a new buy position is created it is always created with the label "BuyPosition" and Sells are created with"SellPosition"
Is there some behaviour that I need to be aware off ?
private void OpenClosePosition(char b_type, double current_high, double current_low)
{
var BuyPosition = Positions.Find("BuyPosition");
var SellPosition = Positions.Find("SellPosition");
gareth-h-jones
03 May 2017, 11:11
RE:
gareth-h-jones said:
@gareth-h-jones