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

Code Help



PureBytes Links

Trading Reference Links

Hello List,

Happy holidays...

I am trying to code up a buy based on bar high and low to enter if
conditions are met over the next 5 bars. My attempt is posted below. I cant
get it to enter at the correct price. Any help is appreciated.

Thanks
Ned



Input: NumCont(1);
Vars: 	MP(0),
		EntryPr(0),
		StopPr(0),
		Lo(0),
		Hi(0);

MP = MarketPosition;

If  CurrentBar > 1
	and MP<>1

Then Begin
		IF	PercentR(35) > 75
		and PercentR(35)[1] < 75 Then
		Value1 = BarNumber;
		Hi = High; 
		Lo = low;

		EntryPr = Hi + (.5*(Hi-Lo));
		StopPr = Lo - (.5*(Hi-Lo));			

			
If Currentbar <= Value1 + 5 then
		Buy ("L") (NumCont) Contracts  EntryPr Limit;
End;