Gamestudio Links
Zorro Links
Newest Posts
Help with plotting multiple ZigZag
by degenerate_762. 04/30/24 23:23
M1 Oversampling
by 11honza11. 04/30/24 08:16
Trading Journey
by howardR. 04/28/24 09:55
Zorro Trader GPT
by TipmyPip. 04/27/24 13:50
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
2 registered members (7th_zorro, AndrewAMD), 911 guests, and 4 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
TICKS flag #453841
08/17/15 07:18
08/17/15 07:18
Joined: Jan 2015
Posts: 5
G
Georgez Offline OP
Newbie
Georgez  Offline OP
Newbie
G

Joined: Jan 2015
Posts: 5
In my script enters and exits are within the same bar in most cases, as Stop and TakeProfit are smaller ATR.
So I use the TICKS flag, but still get 100% profitable trades and unreal annual profit.
Why TICKS does not work?

Code:
function run(){
	BarPeriod = 1440;
	LookBack = 500;
	set(LOGFILE+TICKS);
	StartDate = 2010;
	EndDate   = 2015;
	//while(asset(loop("EUR/USD", "USD/CHF", "USD/JPY", "XAU/USD", "GBP/USD", 
	//                 "USD/CAD", "NZD/USD", "AUD/USD", "GBP/JPY", "UKOil", "USD/JPY", "SPX500", 
	//                 "XAG/USD", "XAU/USD", "SPX500", "Bund"))){ // 
	var atr = ATR(80);
	Stop = 3.3*atr;
	TakeProfit = 0.25*Stop;

	vars Price1 = series( price(0) );
	vars Trend = series(LowPass(Price1, 500));
	var sellPrice, buyPrice, stopPrice, profitPrice;
	
	if(falling(Trend)){
		exitLong();
		if(NumOpenShort<1){
			sellPrice = priceClose(0)+0.9*atr;
			stopPrice = sellPrice + Stop;
			profitPrice = sellPrice - TakeProfit;
			print(TO_LOG, "\n%s: Sell Limit at price %.4f, Stop %.4f, Target %.4f. ", Asset, sellPrice, stopPrice, profitPrice);
			print(TO_HTML, "<br>%s: Sell Limit at price %.4f, Stop %.4f, Target %.4f. ", Asset, sellPrice, stopPrice, profitPrice);
			enterShort(0, -sellPrice); // Sell Limit
		}
	}
	else if(rising(Trend)){
		exitShort();
		if(NumOpenLong<1){ 
			var buyPrice = priceClose(0)-0.9*atr;
			stopPrice = buyPrice - Stop;
			profitPrice = buyPrice + TakeProfit;
			print(TO_LOG, "\n%s: Buy Limit at price %.4f, Stop %.4f, Target %.4f. ", Asset, buyPrice, stopPrice, profitPrice);
			print(TO_HTML, "<br>%s: Buy Limit at price %.4f, Stop %.4f, Target %.4f. ", Asset, buyPrice, stopPrice, profitPrice);
			enterLong(0, -buyPrice); // Buy Limit
		}
	}

	plot("Trend", Trend, 0, GREY);
	plot("atr", atr, NEW, BLUE);
//}

}



http://SSMaker.ru/c78a9da2/

Last edited by Georgez; 08/17/15 07:21.
Re: TICKS flag [Re: Georgez] #453853
08/17/15 10:08
08/17/15 10:08
Joined: Jul 2013
Posts: 75
R
royal Offline
Junior Member
royal  Offline
Junior Member
R

Joined: Jul 2013
Posts: 75
You have found the holy grail eek tongue
Try it again with the FAST flag set, then it should work laugh

Re: TICKS flag [Re: royal] #453887
08/18/15 07:36
08/18/15 07:36
Joined: Jan 2015
Posts: 5
G
Georgez Offline OP
Newbie
Georgez  Offline OP
Newbie
G

Joined: Jan 2015
Posts: 5
Thanks, it seems it is working


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