Gamestudio Links
Zorro Links
Newest Posts
Zorro 2.70
by jcl. 09/29/25 09:24
optimize global parameters SOLVED
by dBc. 09/27/25 17:07
ZorroGPT
by TipmyPip. 09/27/25 10:05
assetHistory one candle shift
by jcl. 09/21/25 11:36
Plugins update
by Grant. 09/17/25 16:28
AUM Magazine
Latest Screens
Rocker`s Revenge
Stug 3 Stormartillery
Iljuschin 2
Galactic Strike X
Who's Online Now
4 registered members (TipmyPip, AndrewAMD, dBc, clonman), 18,643 guests, and 5 spiders.
Key: Admin, Global Mod, Mod
Newest Members
krishna, DrissB, James168, Ed_Love, xtns
19168 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
closing profitable trades (stop) #475361
12/04/18 13:27
12/04/18 13:27
Joined: Apr 2018
Posts: 46
M
MINER Offline OP
Newbie
MINER  Offline OP
Newbie
M

Joined: Apr 2018
Posts: 46
Hello Community,

My Zorro is closing trades which are in profit and the reason for this is a Stop, Zorro is indicating that the trade was closed at a loss but the trade is profitable on mt4. How can i sort this out such that Zorro does not trigger closing profitable trades by Stop but continue the trade since its in favorable direction.

Re: closing profitable trades (stop) [Re: MINER] #475363
12/04/18 13:55
12/04/18 13:55
Joined: Feb 2017
Posts: 1,806
Chicago
AndrewAMD Online
Serious User
AndrewAMD  Online
Serious User

Joined: Feb 2017
Posts: 1,806
Chicago
Post your script.

Re: closing profitable trades (stop) [Re: AndrewAMD] #475364
12/04/18 14:10
12/04/18 14:10
Joined: Apr 2018
Posts: 46
M
MINER Offline OP
Newbie
MINER  Offline OP
Newbie
M

Joined: Apr 2018
Posts: 46
The Code is as below AndrewAMD...

function run()
{
StartDate = 2011;
EndDate = 2018;
set(TICKS);
//Lots = 100;
BarPeriod = 60;
LookBack = 150;
MaxLong = 1;
MaxShort = 1;

//Stop = 50*PIP;
//Trail = 40*PIP;
//TrailLock = 1;

//vars Low = series(priceLow());
//vars high = series(priceHigh());
vars Close = series(priceClose());
vars EMA7 = series(EMA(Close, 7));

if(Close[0] > EMA7[0])
enterLong(TrailingStopLong);


if(Close[0] < EMA7[0])
enterShort(TrailingStopShort);


plot("EMA7", EMA7[0], 0, BLUE);

set(PLOTNOW);
PlotWidth = 1200;
PlotHeight1 = 350;
}

Re: closing profitable trades (stop) [Re: MINER] #475367
12/04/18 14:42
12/04/18 14:42
Joined: Feb 2017
Posts: 1,806
Chicago
AndrewAMD Online
Serious User
AndrewAMD  Online
Serious User

Joined: Feb 2017
Posts: 1,806
Chicago
The entire script, please. You left out the TMF's, which are critical.

Re: closing profitable trades (stop) [Re: AndrewAMD] #475455
12/11/18 11:47
12/11/18 11:47
Joined: Apr 2018
Posts: 46
M
MINER Offline OP
Newbie
MINER  Offline OP
Newbie
M

Joined: Apr 2018
Posts: 46
int TrailingStopLong()
{
//adjust the stop only when the trade is in profit
if(TradeIsOpen and TradeProfit > 0) //////TradeStopLimit = max(TradeStopLimit,LL(3));
//place the stop at 40 points from current price//bars
TradeStopLimit = max(TradeStopLimit, LL(4));
//plot a line to make the stop limit visible
plot("stop", TradeStopLimit, MINV, BLACK);
//RETURN 0 FOR CHECKING THE LIMITS
return 0;
}


int TrailingStopShort()
{
//adjust the stop only when the trade is in profit
if(TradeIsOpen and TradeProfit > 0)
//place the stop at 40 points from current price//bars
TradeStopLimit = max(TradeStopLimit, HH(4));
//plot a line to make the stop limit visible
plot("stop", TradeStopLimit, MINV, BLACK);
//RETURN 0 FOR CHECKING THE LIMITS
return 0;
}


Moderated by  Petra 

Powered by UBB.threads™ PHP Forum Software 7.7.1