oh, it doesn't work. sorry to bother you, but it opens more trades then in the numShortLevels defined and the spacing between is random.

here the code i use:

Code:
int numShortLevels = 10;
int numLongLevels = 2;
bool flg = TRUE;
int i;
function run()
{
	StartDate = 2012;
	//set(TICKS);
	if(numShort() == 0 and flg == TRUE)
	{
		enterShort();
		flg = FALSE;
	}
	
		TimeWait = 1000; 
		for(i = NumOpenShort; i < numShortLevels; i++)
		{
			enterShort(0, priceClose() - i*300*PIP);
		}
	 
}



maybe i'm doing something wrong. i think it has something to do with the priceClose() in the enterShort().
it doesnt need the priceClose(), what it needs is the OrderOpenPrice of the last opened order to calculate the spacing, but i don't know how to get this values.
i looked into the trading.h, but didn't get the TRADE struct to work.

Last edited by PriNova; 11/21/12 19:03.