Gamestudio Links
Zorro Links
Newest Posts
New Zorro version 2.35
by jcl. 02/24/21 14:40
findContract not finding a contract
by strimp099. 02/24/21 07:33
Zorro - import diff time zones csv
by AndrewAMD. 02/23/21 17:52
Using stablecoin as CCY on binance
by marr. 02/23/21 03:08
dataNew broken?
by DdlV. 02/23/21 00:55
Stop and profit/loss targets
by jpslvie. 02/22/21 19:08
Higher for at least N days in a row
by strimp099. 02/22/21 07:53
general questions about multitasking
by faustf. 02/21/21 23:36
AUM Magazine
Latest Screens
Scheherazade's Journey
Paradox Vector
The Space Between
Pogostuck: Rage With Your Friends
Who's Online Now
10 registered members (AndrewAMD, dpn, Quad, Dooley, 3run, MooseMannequin, marr, FLD, TedMar, 1 invisible), 456 guests, and 3 spiders.
Key: Admin, Global Mod, Mod
Newest Members
LorraineJones, SkNiX, wongkrezi, Wolf19, traderlivy
18599 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Moving Average crossover #478595
11/12/19 17:00
11/12/19 17:00
Joined: Nov 2019
Posts: 2
G
gra9 Offline OP
Guest
gra9  Offline OP
Guest
G

Joined: Nov 2019
Posts: 2
Hi Guys,

I'm new here,

How would i write a simple strategy of buying on a moving average cross over(simple MA)

if 13/31 moving average crosses over on(5 minute chart) upside buy.
if 13/31 moving average crosses over on(5 minute chart) downside the sell.

Thank you.
Blessings.

Re: Moving Average crossover [Re: gra9] #478601
11/13/19 10:00
11/13/19 10:00
Joined: Aug 2019
Posts: 22
F
felixfx Offline
Newbie
felixfx  Offline
Newbie
F

Joined: Aug 2019
Posts: 22
function run()
{
set(PLOTNOW);
StartDate = 20100101;
EndDate = 20101231;
BarPeriod = 5;
vars close = series(priceClose());
vars sma13 = series(SMA(close, 13));
vars sma31 = series(SMA(close, 31));

if(crossOver(sma13, sma31)) enterLong();
if(crossUnder(sma13, sma31)) enterShort();

plot("sma13", sma13, MAIN, BLUE);
plot("sma31", sma31, 0, RED);
}

you'll find that a moving average crossover strategy loses money.

Last edited by felixfx; 11/13/19 10:05.
Re: Moving Average crossover [Re: felixfx] #478603
11/13/19 10:43
11/13/19 10:43
Joined: Nov 2019
Posts: 2
G
gra9 Offline OP
Guest
gra9  Offline OP
Guest
G

Joined: Nov 2019
Posts: 2
Thank you so much !!!
I currently use trade-ideas.com , whioh does not let me do custom moving averages like this , how do i get alerts on such signals in real time ?
Would love to have even a simple file generated in realtime , that will give me all these alerts say on a list of 30 stocks, or perhaps on the Nasdaq and New York.
Thank you !!! Blessings !!!

Last edited by gra9; 11/13/19 10:44.
Re: Moving Average crossover [Re: gra9] #478651
11/20/19 13:57
11/20/19 13:57
Joined: Aug 2019
Posts: 22
F
felixfx Offline
Newbie
felixfx  Offline
Newbie
F

Joined: Aug 2019
Posts: 22
I suppose you'll have to find a way to connect Zorro to trade-ideas.com's software, which I am completely unfamiliar with, and therefore would not even know whether they allow algorithmic trading.

I would suggest just sticking with Zorro begin backtesting ideas until you have developed a strategy that works.

Re: Moving Average crossover [Re: gra9] #482267
01/20/21 21:46
01/20/21 21:46
Joined: Jan 2021
Posts: 4
F
Figurehunter Offline
Guest
Figurehunter  Offline
Guest
F

Joined: Jan 2021
Posts: 4
Alerts are possible with Zorro using email. I haven't measured the delay. These snippets are straight from the help file.

void main()
{
string To = "<me@myself.org>";
string From = "<zorro_alert@gmail.com>";
string Subject = "Zorro Message";
string Body = "Zorro has sent you a message!";
string Server = "smtps://smtp.gmail.com:465";
string User = "zorro_alert@gmail.com";
string Password = "zorros_password";
email(To,From,Subject,Body,Server,User,Password);
}

or....(my friend said he will use this code so he can then forward to a text alert which could be faster)


// send an email when a trade is enteredfunction sendEmailAboutTrade(){
// compose the message
string Content = strf("content=Zorro has entered a trade!\n%d Lots of %s",
Lots,Asset);
http_transfer("http://www.myserver.com/zorromail.php",Content);}


Moderated by  Petra 

Gamestudio download | chip programmers | Zorro platform | shop | Data Protection Policy

oP group Germany GmbH | Birkenstr. 25-27 | 63549 Ronneburg / Germany | info (at) opgroup.de

Powered by UBB.threads™ PHP Forum Software 7.7.1