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
Data from CSV not parsed correctly
by jcl. 04/26/24 11:18
Why Zorro supports up to 72 cores?
by jcl. 04/26/24 11:09
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
3 registered members (Quad, VoroneTZ, PeroPero), 841 guests, and 3 spiders.
Key: Admin, Global Mod, Mod
Newest Members
wandaluciaia, Mega_Rod, EternallyCurious, howardR, 11honza11
19049 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: 27,986
Frankfurt
jcl Offline

Chief Engineer
jcl  Offline

Chief Engineer

Joined: Jul 2000
Posts: 27,986
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: 27,986
Frankfurt
jcl Offline

Chief Engineer
jcl  Offline

Chief Engineer

Joined: Jul 2000
Posts: 27,986
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