[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Please help with buy stop code



PureBytes Links

Trading Reference Links


I've been having a tough time trying to code a buy stop that references the 
open of the bar to trade. In other words, I'd like to (If condition1[1] then) 
buy open + x points stop; Is this possible? Data is EOD.

I've also notice that I get two very different results when I omit the word 
"points" from my buy order. The two versions of the code are as follows:
1) If MarketPosition = 0 then Begin
	DaysLong = 0;
	Val2 = Open + 5;
	Buy Val2 Stop;
End;
2) If MarketPosition = 0 then Begin
	DaysLong = 0;
	Val2 = Open + 5;
	Buy Val2 points Stop;
End;
I'm sure I'm overlooking the obvious, but I thought that the two codes would 
work the same. Why don't they?

I've spent too many hours trying to decipher where the problem is, reading 
print statements and such, so any fresh perspective will be very welcome.

Many thanks,

Dan Poiree