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
1 registered members (TipmyPip), 18,388 guests, and 6 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
WHY DOES THIS HAPPEN WHILE LIVE TRADING #475103
11/23/18 11:16
11/23/18 11:16
Joined: Apr 2018
Posts: 46
M
MINER Offline OP
Newbie
MINER  Offline OP
Newbie
M

Joined: Apr 2018
Posts: 46
Hello Everyone, I have a simple script on simple moving averages, the averages in the script are the same shown in the attached mt4 chart, but i cant figure out why zorro is repeatedly trading whenever there are some supports/resistance and the script is just on crossovers/unders. the additional arrow shows the bar when zorro placed a buy trade.....how can i avoid this behavior. Your help is highly appreciated guys.

Attached Files Capture1.PNG
Re: WHY DOES THIS HAPPEN WHILE LIVE TRADING [Re: MINER] #475104
11/23/18 11:45
11/23/18 11:45
Joined: Jul 2000
Posts: 28,024
Frankfurt
jcl Offline

Chief Engineer
jcl  Offline

Chief Engineer

Joined: Jul 2000
Posts: 28,024
Frankfurt
It's a bit difficult to tell you what's wrong with your script without seeing it, but one request: Please switch off the CAPS key when typing titles. Thank you.

Re: WHY DOES THIS HAPPEN WHILE LIVE TRADING [Re: MINER] #475106
11/23/18 12:34
11/23/18 12:34
Joined: Apr 2018
Posts: 46
M
MINER Offline OP
Newbie
MINER  Offline OP
Newbie
M

Joined: Apr 2018
Posts: 46
Well noted jcl,

Below is the code, Kindly Help.

........
function run()
{


StartDate = 2005;
BarPeriod = 60;
Lots = 30;
MaxLong = 1;
MaxShort = 1;
Stop = 2 * ATR(14);
Trail = 2 * ATR(14);
//EntryTime =
Entry = -5*PIP;
Algo = "SMA 15,5"

vars Close = series(priceClose());
vars SMAFast = series(SMA(Close, 5));
vars SMASlow = series(SMA(Close, 15));

if(crossOver(SMAFast, SMASlow))
enterLong(TrailingStopLong);
else if(crossUnder(SMAFast, SMASlow))
exitLong(TrailingStopShort);
//exit long and go short if 5 SMA crosses under 15 SMA
if(crossUnder(SMAFast, SMASlow))
enterShort();
else if(crossOver(SMAFast, SMASlow))
exitShort();
.......

Re: WHY DOES THIS HAPPEN WHILE LIVE TRADING [Re: MINER] #475115
11/23/18 15:02
11/23/18 15:02
Joined: Jul 2000
Posts: 28,024
Frankfurt
jcl Offline

Chief Engineer
jcl  Offline

Chief Engineer

Joined: Jul 2000
Posts: 28,024
Frankfurt
Something is wrong with your TMF parameter. You can use it for enterLong, but not for exitLong. Unexpected trades are probably caused by the Entry variable.


Moderated by  Petra 

Powered by UBB.threads™ PHP Forum Software 7.7.1