Entry... TradeEntryLimit

Posted By: JeyKey II

Entry... TradeEntryLimit - 03/08/16 17:02

doesent work as described in the Manual:
"Enter the trade only when the price reaches a certain value at the next bar"

A simple Example:
Code:
function run()
{
	StartDate = 2013;
	EndDate = 2014;
	set(PLOTNOW);
	PlotBars = 480; 					
		
	BarPeriod = 60;
//-----------------------
	Entry = 1.052;   // Entry Price
//-----------------------
	Stop = TakeProfit = 2*ATR(100);
	Lots = 1;

	if(NumOpenTotal == 0)
	{
		enterShort();
		plot("S",priceClose()-10*PIP,MAIN+TRIANGLE4,RED); // Plot "Pfeil ab"
	}
}


Zorro open Trades not only at Price = 1.052


Example2: Entry modification with TMF
Code:
#############################
function Order();

function run()
{
	StartDate = 2013;
	EndDate = 2014;
	set(PLOTNOW);
	PlotBars = 480; 					
		
	BarPeriod = 60;
//-----------------------
//	Entry = 1.052;   // Entry Price
//-----------------------
	Stop = TakeProfit = 2*ATR(100);
	Lots = 1;

	if(NumOpenTotal == 0)
	{
		enterShort(Order);
		plot("S",priceClose()-10*PIP,MAIN+TRIANGLE4,RED); // Plot "Pfeil ab"
	}
}

int Order()
{
	if (TradeIsShort)
	{
		TradeEntryLimit = 1.060;
	}
	return 0;	
}


TradeEntyLinit has no effect
Posted By: jcl

Re: Entry... TradeEntryLimit - 03/08/16 17:08

This is no entry limit, it is an entry stop. You can easily check if the script does what you want: first print the price at entering the trade, then the opening price in the "TradeIsEntry" event. The first price must be above the entry stop and the second below or in the proximity of the entry stop.

© 2024 lite-C Forums