Gamestudio Links
Zorro Links
Newest Posts
Data from CSV not parsed correctly
by dr_panther. 05/06/24 18:50
Help with plotting multiple ZigZag
by degenerate_762. 04/30/24 23:23
M1 Oversampling
by 11honza11. 04/30/24 08:16
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
1 registered members (AndrewAMD), 801 guests, and 6 spiders.
Key: Admin, Global Mod, Mod
Newest Members
firatv, wandaluciaia, Mega_Rod, EternallyCurious, howardR
19050 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Using different entry #440636
04/29/14 07:59
04/29/14 07:59
Joined: Jan 2013
Posts: 68
I
ibra Offline OP
Junior Member
ibra  Offline OP
Junior Member
I

Joined: Jan 2013
Posts: 68
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!

Re: Using different entry [Re: ibra] #440642
04/29/14 10:26
04/29/14 10:26
Joined: May 2013
Posts: 245
S
swingtraderkk Offline
Member
swingtraderkk  Offline
Member
S

Joined: May 2013
Posts: 245
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.


Moderated by  Petra 

Gamestudio download | chip programmers | Zorro platform | shop | Data Protection Policy

oP group Germany GmbH | Birkenstr. 25-27 | 63549 Ronneburg / Germany | info (at) opgroup.de

Powered by UBB.threads™ PHP Forum Software 7.7.1