Gamestudio Links
Zorro Links
Newest Posts
Data from CSV not parsed correctly
by EternallyCurious. 04/18/24 10:45
StartWeek not working as it should
by Zheka. 04/18/24 10:11
folder management functions
by VoroneTZ. 04/17/24 06:52
lookback setting performance issue
by 7th_zorro. 04/16/24 03:08
zorro 64bit command line support
by 7th_zorro. 04/15/24 09:36
Zorro FIX plugin - Experimental
by flink. 04/14/24 07:48
Zorro FIX plugin - Experimental
by flink. 04/14/24 07:46
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
1 registered members (AndrewAMD), 559 guests, and 2 spiders.
Key: Admin, Global Mod, Mod
Newest Members
EternallyCurious, 11honza11, ccorrea, sakolin, rajesh7827
19046 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,978
Frankfurt
jcl Offline

Chief Engineer
jcl  Offline

Chief Engineer

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

Chief Engineer
jcl  Offline

Chief Engineer

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