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
5 registered members (Quad, AndrewAMD, Imhotep, TipmyPip, Edgar_Herrera), 809 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
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,718
Chicago
AndrewAMD Online
Serious User
AndrewAMD  Online
Serious User

Joined: Feb 2017
Posts: 1,718
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,718
Chicago
AndrewAMD Online
Serious User
AndrewAMD  Online
Serious User

Joined: Feb 2017
Posts: 1,718
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