Using different entry

Posted By: ibra

Using different entry - 04/29/14 07:59

Hi guys,

I'm trying to do use the following code in my script to mess around with some other entries and to see what the results end up to
Code:
Entry = -(priceLow()-10*PIP);



But I can't really get it to work.

My code looks like this:

Code:
int Entryspec() 

{
	
Entry = -(priceLow()-50*PIP);
}
  


function run()
{

	LookBack = 500;
	StartDate = 20080101;
	EndDate = 20080201;
   BarPeriod = 60;

var threshold = 0.5;

   
vars Price = series(price());
vars Norm = series(Normalize(Price, 50));





 

if(crossUnder(Norm, threshold))
	enterShort(Entryspec);

	
Stop = 2*ATR(30);
Trail = 50*PIP;


plot("Normalize", Norm[0],NEW,RED);
plot("Thresh", threshold,0,BLACK);
plot("Thresh2", -threshold,0,BLACK);

  
   	
	
	
	
}




Yet, the system still enters trades where I don't want it to.
See the image for an example: http://sv.tinypic.com/view.php?pic=dli99d&s=8#.U14if_l_s8o

As you might have guessed, I would like to avoid the whipsaws by setting a stop entry instead of a normal entry. That is, put a stop order 50 pips under current low. Yet, like I said, it still enters som weird trades, for example where I marked in the pictures.

Any advice is appreciated!

Thanks!
Posted By: swingtraderkk

Re: Using different entry - 04/29/14 10:26

You seem to be setting a limit. A stop entry requires a positive value.

Quote:
Entry

Enter the trade only when the price reaches a certain value at the next bar (default = 0 = enter at market). The value can be given either directly as an Ask price, or as a distance to the current close price. A positive price or distance constitutes an entry stop, a negative price or distance an entry limit. An entry limit buys when the price is at or worse than the limit; it increases the profit of the trade as it buys at a better price. An entry stop buys when the price is at or better than the limit; it reduces the profit, but enters only when the price moved in favourable direction, and thus acts as an additional trade filter.
© 2024 lite-C Forums