Gamestudio Links
Zorro Links
Newest Posts
Blobsculptor tools and objects download here
by NeoDumont. 03/28/24 03:01
Issue with Multi-Core WFO Training
by aliswee. 03/24/24 20:20
Why Zorro supports up to 72 cores?
by Edgar_Herrera. 03/23/24 21:41
Zorro Trader GPT
by TipmyPip. 03/06/24 09:27
VSCode instead of SED
by 3run. 03/01/24 19:06
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
3 registered members (VoroneTZ, monk12, Quad), 829 guests, and 4 spiders.
Key: Admin, Global Mod, Mod
Newest Members
sakolin, rajesh7827, juergen_wue, NITRO_FOREVER, jack0roses
19043 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Page 5 of 6 1 2 3 4 5 6
Re: Z System result sharing? [Re: RTG] #464581
02/27/17 16:56
02/27/17 16:56
Joined: Feb 2017
Posts: 24
sodiumchloride Offline
Newbie
sodiumchloride  Offline
Newbie

Joined: Feb 2017
Posts: 24
SR 0.06, lots of drawdowns but running stable for years - very interesting...

Quote:
"That’s a robot that looks for short-term divergences – in other words, discrepancies between the movement of price and the momentum at which it’s moving.
and hes amount of trades is correlated with high volatility."

Re: Z System result sharing? [Re: sodiumchloride] #464712
03/07/17 01:59
03/07/17 01:59
Joined: Feb 2014
Posts: 181
R
RTG Offline
Member
RTG  Offline
Member
R

Joined: Feb 2014
Posts: 181
I've found out a little more about this approach from the website. It shouldn't be hard to code this for Zorro and test it.

THE FINCH
The Finch robot looks for divergences on a 5 minute chart. When it finds a divergence, it will take a trade. If the trade is a loser, it will look for one more trade. If that second trade is a loser, the robot will either close all the trades or stay in the trades until they come back (you can tell the robot to choose either style of trading). Most people who buy the robots run Finch on 3-5 currency pairs, and let the robot run on its own.

Re: Z System result sharing? [Re: RTG] #464782
03/12/17 05:34
03/12/17 05:34
Joined: Feb 2014
Posts: 181
R
RTG Offline
Member
RTG  Offline
Member
R

Joined: Feb 2014
Posts: 181
Found the MT4 code for what I believe is this system. Seems a bit long complex. I think it would be far shorter in Zorro.

//+------------------------------------------------------------------+
//| Trifecta Automatic.mq4 |
//| Copyright 2015, Rob Booker |
//| http://www.tfl365.com |
//+------------------------------------------------------------------+
#property copyright "Copyright 2015, Rob Booker"
#property link "http://www.tfl365.com"
#property version "ao-20160122 21.56"
#property icon "\Images\Rob-Booker_S2-64.ico"
#property description "Added code as preemptive measure to avoid trade timeout error."
#property description "Added code to deal with manually deleted second trade."
#property description "ao-20160105 20.31: with correct magic number EA regains control of"
#property description "its trades. Trade functions repeated after errors."
/*
#property description "ao-20160105 20.31: Reliability enhancement of Rollover Finch v1.9.mq4 from"
#property description "Rollover_Finch_v1.9.zip, available at TFL Membership at /tfl.mykajabi.com."
#property description "Modified init() so EA regains control of trades it made. Make sure you"
#property description "specify the correct Magic number."
#property description "Modified OpenTrade() and CloseAllTrades() so trade functions will repeat"
#property description "if errors occur. Status information and errors are printed in the Experts log"
#property description "to inform you of what's going on."
*/
#property strict

#include <stdlib.mqh>
#include <stderror.mqh>

extern string WARNING = "Using a robot carries risk, use on demo account FIRST";
extern int Slippage=5;
extern int Max_Spread_Pips=5;
extern int Magic = 12345;

extern double First_Trade_Lots=0.05;
extern double Second_Trade_Lots=0.5;

extern int Pips_To_Trade_2 = 10;

extern string Stop_Type="Default no stop loss";
extern int Stop_Loss_In_Pips=0;

extern string Profit_In_Dollars = "Profit Targets in Dollar Value format";
extern double First_Trade_Profit_In_Dollars=10.0;
extern double Second_Trade_Profit_In_Dollars=100.0;

extern bool Break_Even = false;
extern double Break_Even_At_Profit = 50.0;

extern int CandlesBack = 30;
extern int RSIPeriod = 21;
extern int MomentumPeriod = 20;
extern int FastMAPeriod=12;
extern int SlowMAPeriod=26;
extern int SignalMAPeriod=9;
extern int KPeriod=70;
extern int DPeriod=10;
extern int Slowing=10;
extern int Stochastic_Upper=70;
extern int Stochastic_Lower=30;

extern bool Mail_Alert = false;
extern bool PopUp_Alert = false;
extern bool Sound_Alert = false;
extern bool SmartPhone_Notifications=false;

double UsePoint;
int UseSlippage;

double Order_Stop;

datetime TheTime;

int LastKDB;
int LastKDS;

double Order_Profit;

string Order_Type = "BuySell";
double PriceForSecond;

bool BreakEven=false;

int TotalTrades=0;

bool BuysNotAllowed=false;
bool SellsNotAllowed=false;

int Tickets[2] = {0, 0};

int init() {
int i = 0, x;
string info = "";

if (!IsTradeAllowed() || !IsExpertEnabled())
Alert("Trading is not allowed / Expert is not enabled");

UsePoint = PipPoint(Symbol());
UseSlippage = GetSlippage(Symbol(),Slippage);

for(x = 0; x < OrdersTotal(); x++)
if (OrderSelect(x, SELECT_BY_POS, MODE_TRADES))
if (OrderSymbol() == Symbol() && OrderMagicNumber() == Magic) {
Tickets[i++] = OrderTicket();
info += ", #" + IntegerToString(OrderTicket());
if (OrderType() == OP_BUY) {
Order_Type = "Buy";
if (i == 1) {
PriceForSecond = OrderOpenPrice() - (Pips_To_Trade_2 * UsePoint);
Order_Stop = OrderOpenPrice() - (Stop_Loss_In_Pips * UsePoint);
}
}
else {
Order_Type = "Sell";
if (i == 1) {
PriceForSecond = OrderOpenPrice() + (Pips_To_Trade_2 * UsePoint);
Order_Stop = OrderOpenPrice() + (Stop_Loss_In_Pips * UsePoint);
}
}
}
TotalTrades = i;
Print("Init: Total " + Order_Type + " Trades = " + IntegerToString(TotalTrades) + info);

return(0);
}

int deinit()
{
return(0);
}

int start() {
if (TotalTrades) {
CheckProfit();
Comment(Order_Type + " Trades: " + IntegerToString(TotalTrades));
}
else
Comment("");

if (TotalTrades == 2)
return(0);

if(TheTime<Time[1])
{
if(!BuysNotAllowed && ((Order_Type=="BuySell" && TotalTrades==0) || (Order_Type=="Buy" && TotalTrades==1 && Bid<=PriceForSecond)) && RSIBuyCheck(1)) OpenTrade("Buy");

if(!SellsNotAllowed && ((Order_Type=="BuySell" && TotalTrades==0) || (Order_Type=="Sell" && TotalTrades==1 && Bid>=PriceForSecond)) && RSISellCheck(1)) OpenTrade("Sell");

TheTime=Time[1];
}
return(0);
}

void CheckProfit() {
double Profits=0.0;

for (int x = 0; x < TotalTrades; x++)
if (OrderSelect(Tickets[x], SELECT_BY_TICKET) && OrderCloseTime() == 0)
Profits += OrderProfit();
else if (x == 1) { // second trade closed manually
Tickets[x] = 0;
TotalTrades--;
}

if ((TotalTrades == 1 && Profits >= First_Trade_Profit_In_Dollars) ||
(TotalTrades == 2 && Profits >= Second_Trade_Profit_In_Dollars) ||
(Stop_Loss_In_Pips > 0 && TotalTrades > 0 && Order_Type == "Buy" && Ask <= Order_Stop) ||
(Stop_Loss_In_Pips > 0 && TotalTrades > 0 && Order_Type == "Sell" && Bid >= Order_Stop)) {
Print("Profit is " + DoubleToString(Profits, 2));
CloseAllTrades();
return;
}

if (Break_Even && !BreakEven && Profits >= Break_Even_At_Profit) {
Print("Rollover Finch Break Even Begin");
BreakEven = true;
}
if (Break_Even && BreakEven && Profits <= 0)
CloseAllTrades();

return;
}

void CloseAllTrades() {
int i, TT = TotalTrades, GLE;
string info;

if (!IsConnected()) {
Print("CloseAllTrades(: " + TimeToString(TimeCurrent(), TIME_DATE | TIME_SECONDS) + " IsConnected() is false");
return;
}
if (IsTradeContextBusy()) {
Print("CloseAllTrades(: " + TimeToString(TimeCurrent(), TIME_DATE | TIME_SECONDS) + " IsTradeContextBusy() is true");
return;
}

for (int x = 0; x < TT; x++) {
if (OrderSelect(Tickets[x], SELECT_BY_TICKET)) {
if (OrderType() == OP_BUY) {
for (i = 0; i < 10 && !OrderClose(OrderTicket(), OrderLots(), Bid, UseSlippage, clrRed); i++) {
GLE = GetLastError();
info = TimeToString(TimeCurrent(), TIME_DATE | TIME_SECONDS) + " OrderClose(#" +
IntegerToString(OrderTicket()) + ", " + DoubleToString(OrderLots(), 2) +
", " + DoubleToString(Bid, Digits) + " (Bid), " + IntegerToString(UseSlippage) +
"): " + DescribeError(GLE);
Print(info);
if (GLE && IsFatalTradeError(GLE))
break;
Sleep(3000);
RefreshRates();
}
if (i < 10) {
Tickets[x] = 0;
TotalTrades--;
}
}
else if (OrderType()==OP_SELL) {
for (i = 0; i < 10 && !OrderClose(OrderTicket(), OrderLots(), Ask, UseSlippage, clrGreen); i++) {
GLE = GetLastError();
info = TimeToString(TimeCurrent(), TIME_DATE | TIME_SECONDS) + " OrderClose(#" +
IntegerToString(OrderTicket()) + ", " + DoubleToString(OrderLots(), 2) +
", " + DoubleToString(Ask, Digits) + " (Ask), " + IntegerToString(UseSlippage) +
"): " + DescribeError(GetLastError());
Print(info);
if (GLE && IsFatalTradeError(GLE))
break;
Sleep(3000);
RefreshRates();
}
if (i < 10) {
Tickets[x] = 0;
TotalTrades--;
}
}
}
}
if (TotalTrades == 0) {
BreakEven = false;
Order_Type = "BuySell";
TheTime = Time[1];
Tickets[0] = 0;
Tickets[1] = 0;
}

return;
}

double PipPoint(string Currency) {
double CalcPoint = 0.0001;
int CalcDigits = (int)MarketInfo(Currency, MODE_DIGITS);

if (CalcDigits == 2 || CalcDigits == 3)
CalcPoint = 0.01;

return CalcPoint;
}

int GetSlippage(string Currency, int SlippagePips) {
int CalcSlippage = SlippagePips * 10;
int CalcDigits = (int)MarketInfo(Currency, MODE_DIGITS);

if (CalcDigits == 2 || CalcDigits == 4)
CalcSlippage = SlippagePips;

return CalcSlippage;
}

void OpenTrade(string Type) {
int i, GLE;
string info;
double TheSpread = MarketInfo(Symbol(), MODE_SPREAD) / 10.0;
double Lots = First_Trade_Lots;

if (!IsConnected()) {
Print("OpenTrade: " + TimeToString(TimeCurrent(), TIME_DATE | TIME_SECONDS) + " IsConnected() is false");
return;
}
if (IsTradeContextBusy()) {
Print("OpenTrade: " + TimeToString(TimeCurrent(), TIME_DATE | TIME_SECONDS) + " IsTradeContextBusy() is true");
return;
}

if(Digits==2 || Digits==4)
TheSpread = MarketInfo(Symbol(),MODE_SPREAD);

if (TheSpread > Max_Spread_Pips) {
Print("Spread too large, can't place trade");
return;
}

if (TotalTrades == 1)
Lots = Second_Trade_Lots;

if (Type == "Buy") {
for (i = 0; i < 10 && (Tickets[TotalTrades] = OrderSend(Symbol(), OP_BUY, Lots, Ask, UseSlippage, 0, 0,
"Buy Finch Trade: " + Symbol(), Magic, 0, clrGreen)) == -1; i++) {
GLE = GetLastError();
info = "OpenTrade: " + TimeToString(TimeCurrent(), TIME_DATE | TIME_SECONDS) + ": Buy OrderSend #"
+ IntegerToString(TotalTrades + 1) + ": " + DescribeError(GLE);
Print(info);
if (GLE && IsFatalTradeError(GLE))
return;
Sleep(3000);
RefreshRates();
}
if (i == 10)
return;

if(GetLastError()==4110) {BuysNotAllowed=true;return;}

if (OrderSelect(Tickets[TotalTrades], SELECT_BY_TICKET)) {
if (Stop_Loss_In_Pips > 0 && TotalTrades == 0)
Order_Stop = OrderOpenPrice() - (Stop_Loss_In_Pips * UsePoint);
PriceForSecond = OrderOpenPrice() - (Pips_To_Trade_2 * UsePoint);
}

TotalTrades++;
Order_Type="Buy";

SendAlert("New Trifecta Rollover Finch Buy Trade on the "+Symbol());
}
else if (Type == "Sell") {
for (i = 0; i < 10 && (Tickets[TotalTrades] = OrderSend(Symbol(), OP_SELL, Lots, Bid, UseSlippage, 0, 0,
"Sell Finch Trade: "+Symbol(), Magic, 0, clrRed)) == -1; i++) {
GLE = GetLastError();
info = "OpenTrade: " + TimeToString(TimeCurrent(), TIME_DATE | TIME_SECONDS) + ": Sell OrderSend #"
+ IntegerToString(TotalTrades + 1) + ": " + DescribeError(GLE);
Print(info);
if (GLE && IsFatalTradeError(GLE))
return;
Sleep(3000);
RefreshRates();
}
if (i == 10)
return;

if(GetLastError()==4111) {SellsNotAllowed=true;return;}

if (OrderSelect(Tickets[TotalTrades], SELECT_BY_TICKET)) {
if (Stop_Loss_In_Pips > 0 && TotalTrades == 0)
Order_Stop = OrderOpenPrice() + (Stop_Loss_In_Pips * UsePoint);
PriceForSecond = OrderOpenPrice() + (Pips_To_Trade_2 * UsePoint);
}

TotalTrades++;
Order_Type="Sell";

SendAlert("New Trifecta Rollover Finch Sell Trade on the "+Symbol());
}
return;
}

bool RSISellCheck(int Loc)
{
double RSIMain = iRSI(Symbol(),0,RSIPeriod,PRICE_CLOSE,Loc);
if(RSIMain < 50) return(false);
for(int x=Loc;x<=Loc+2;x++)
{
if(High[x]>High[Loc])return(false);
}
for(int y=Loc+4;y<(Loc+CandlesBack);y++)
{
if(High[y]>High[Loc]) break;
int s=y;
for(int z=y-2;z<=y+2;z++)
{
if(High[z]>High[y]){y++; break;}
}
if(s!=y){y--; continue;}
bool OB=false;
for(int k=Loc;k<=y;k++)
{
double RSIOB = iRSI(Symbol(),0,RSIPeriod,PRICE_CLOSE,k);
if(RSIOB>70) {OB=true; break;}
}
if(OB==false) continue;
double Mom1=iMomentum(Symbol(),0,MomentumPeriod,PRICE_CLOSE,Loc);
double Mom2=iMomentum(Symbol(),0,MomentumPeriod,PRICE_CLOSE,y);
if(Mom1>Mom2) continue;
LastKDS=y;
return(true);
}
return(false);
}
bool RSIBuyCheck(int Loc)
{
double RSIMain = iRSI(Symbol(),0,RSIPeriod,PRICE_CLOSE,Loc);
if(RSIMain > 50) return(false);
for(int x=Loc;x<=Loc+2;x++)
{
if(Low[x]<Low[Loc])return(false);
}
for(int y=Loc+4;y<(Loc+CandlesBack);y++)
{
if(Low[y]<Low[Loc]) break;
int s=y;
for(int z=y-2;z<=y+2;z++)
{
if(Low[z]<Low[y]){y++; break;}
}
if(s!=y){y--; continue;}
bool OB=false;
for(int k=Loc;k<=y;k++)
{
double RSIOB = iRSI(Symbol(),0,RSIPeriod,PRICE_CLOSE,k);
if(RSIOB<30) {OB=true; break;}
}
if(OB==false) continue;
double Mom1=iMomentum(Symbol(),0,MomentumPeriod,PRICE_CLOSE,Loc);
double Mom2=iMomentum(Symbol(),0,MomentumPeriod,PRICE_CLOSE,y);
if(Mom1<Mom2) continue;
LastKDB=y;
return(true);
}
return(false);
}
void SendAlert(string Message)
{
if(Mail_Alert) SendMail("New Rollover Finch Alert",Message);
if(PopUp_Alert) Alert(Message);
if(Sound_Alert) PlaySound("alert.wav");
if(SmartPhone_Notifications) SendNotification(Message);
return;
}

string DescribeError(int ErrorNum) {
return IntegerToString(ErrorNum) + "-" + ErrorDescription(ErrorNum);
}

bool IsFatalTradeError(int GLE) {
return GLE == ERR_INVALID_TRADE_PARAMETERS ||
GLE == ERR_NO_CONNECTION ||
GLE == ERR_MALFUNCTIONAL_TRADE ||
GLE == ERR_TRADE_TIMEOUT ||
GLE == ERR_INVALID_STOPS ||
GLE == ERR_TRADE_DISABLED ||
GLE == ERR_NOT_ENOUGH_MONEY ||
GLE == ERR_TRADE_NOT_ALLOWED ||
GLE == ERR_LONGS_NOT_ALLOWED ||
GLE == ERR_SHORTS_NOT_ALLOWED;
}

Re: Z System result sharing? [Re: RTG] #464784
03/12/17 14:03
03/12/17 14:03
Joined: Dec 2013
Posts: 568
Fuerth, DE
Sphin Offline
User
Sphin  Offline
User

Joined: Dec 2013
Posts: 568
Fuerth, DE
Happy coding! laugh

Re: Z System result sharing? [Re: Sphin] #464793
03/13/17 02:34
03/13/17 02:34
Joined: Feb 2014
Posts: 181
R
RTG Offline
Member
RTG  Offline
Member
R

Joined: Feb 2014
Posts: 181
Going through the code, it does seems overly complex compared to zorro's built in functions.

Re: Z System result sharing? [Re: RTG] #465576
05/04/17 11:25
05/04/17 11:25
Joined: Jan 2017
Posts: 4
Madrid
T
toc17 Offline
Guest
toc17  Offline
Guest
T

Joined: Jan 2017
Posts: 4
Madrid
Hi RTG,
Could you do the porting of the MT4 EA?

Re: Z System result sharing? [Re: toc17] #465624
05/06/17 02:03
05/06/17 02:03
Joined: Feb 2014
Posts: 181
R
RTG Offline
Member
RTG  Offline
Member
R

Joined: Feb 2014
Posts: 181
No I didn't convert. I am running it directly through MT4.

Re: Z System result sharing? [Re: RTG] #466713
06/28/17 13:22
06/28/17 13:22
Joined: Apr 2017
Posts: 10
C
Caine1 Offline
Newbie
Caine1  Offline
Newbie
C

Joined: Apr 2017
Posts: 10
Hello RTG,

how is the startegy doing?
did you create a myfxbook page concerning this strategy?

Re: Z System result sharing? [Re: Caine1] #466802
07/03/17 10:44
07/03/17 10:44
Joined: Jul 2017
Posts: 25
Bangkok
JoFo Offline
Newbie
JoFo  Offline
Newbie

Joined: Jul 2017
Posts: 25
Bangkok
I traded the Z7 and Z 12 Systems live on Oanda Account for 4 Weeks on 10 different accounts.
so far I can say if you start 10 times Z7 and 10 times Z12 Systems even on same time you will get slightly different results. The number of trades will differ after a while and also sometimes the traded asset. The results also differ in a range up to 30 % in a month period.
it look like it depend on to much random ! if you get started with a more profitable system.

Z7 was a headache. Allways loosing money.

Z 12 was much better even when the results differ. Best single result was 35 % profit in one month. So far my Favorit.

i set up the Accounts on 2 Server. Keep in mind that also your server needs updates and sometimes must be restarted. Then you have to switch of your trading systems, closing your trades and restart after Update is done on your Server. So you will anyway have to stop and restart your systems every couple weeks.


If you setup a trading system for live trading:

Set timezone on your server on UTC !

Load up the newest Zorro Version on your server !

Add all necessary Assets to the AssetFix List by Download Script

Create Accounts.csv with your Account data

With Oanda you will have a primary account and can have up to 19 under accounts
create underaccountsV20 hedging enable ! After creating all underacounts you need you can create your V20 token on Oanda website for your Account.csv

Upload all t6 files from the Zorro download Site

start Download Script and choise ALL ASSETS

set Load M 1 Data on 2005-2017 and start by clicking.

after download start training. You can see if all Assets are in and all necessary datas are in the history folder.

If there was no problem and the test results are positive like expected you are ready for trading.

update and reboot your servers and you are ready for trading.


NOW SOME THINGS TO KEEP IN MIND

Never ever rename Z Systems !!!

Allways use a fresh OS System on the server and a fresh Zorro Installation

Never play around on the Z System

Never run a System with an Error message while training or/and when you start TRADE !

make sure you have AssetsFix and not Assetsfix in your Historyfiles


If everything is fine sit back relax and watch the systems trading
 

Last edited by JoFo; 07/03/17 14:41.
Re: Z System result sharing? [Re: JoFo] #466945
07/10/17 10:24
07/10/17 10:24
Joined: Mar 2015
Posts: 25
J
jmb Offline
Newbie
jmb  Offline
Newbie
J

Joined: Mar 2015
Posts: 25
JoFo

This is a really good list of dos and don'ts. The one I fell foul of is
Quote:
Always use a fresh... Zorro Installation

My Z12 didn't do well until I did a complete uninstall and reinstall. Then I simply launched the system, and the results have been much better.

I'd add that it seems to be best to run the Z systems separately in their own discreet, separate subdirectories.

Last edited by jmb; 07/10/17 10:29.
Page 5 of 6 1 2 3 4 5 6

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