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
2 registered members (AndrewAMD, Imhotep), 567 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
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);}

Re: Moving Average crossover [Re: Figurehunter] #487086
01/14/23 21:36
01/14/23 21:36
Joined: Jun 2022
Posts: 6
B
BigW Offline
Newbie
BigW  Offline
Newbie
B

Joined: Jun 2022
Posts: 6
[quote=Figurehunter]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);
}

I have set this up exactly as indicated in the help file and above in a new script page without any code ie to test sending emails separately from any trading script. The setup is using a new Google account set up for this purpose.

After running it I get the message:
Email test compiling...ok, but no 0 or non zero returned.
Does anyone have any experience using Google - or Outlook that works?

Following up I tried to set this up using Runbox instead of gmail and changed maun to a function which when runs returns 1 ie says email sent but still no email for some reason.



Last edited by BigW; 01/15/23 00:55.

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