What is the differance between an Indicator,EA,or Script?

snakedoctor
Posts: 3
Joined: Fri Nov 02, 2012 8:55 pm
Location: Jacksonville Beach, Florida USA

What is the differance between an Indicator,EA,or Script?

Post by snakedoctor »

I tried Jemook's method of sinking Indicators, EA's,and Scripts using Drop Box. Unfortunately now some are mixed up. How do I tell the difference between an Indicator,an EA,or Script?
User avatar
Jemook
Trader
Posts: 1085
Joined: Thu May 10, 2012 10:19 am
Location: Bondi, Sydney, Australia

Re: What is the differance between an Indicator,EA,or Script

Post by Jemook »

Eep! Hi there.

You should sync each folder separately.

Empty4/Experts/Indicators -> Dropbox/Indicators
Empty4/Experts/Scripts -> Dropbox/Templates
Empty4/Templates -> Dropbox/Templates

Then you can link the respective directories in the other Empty4 folders back to the dropbox. Don't try and sync your ea folder (Empty4/Experts) as it contains subdirectories which shouldn't be synced. Only Indicators, Scripts & Templates.

Good luck champ.
Please note I am no longer affiliated with Global Prime. I've moved on to my next adventure with Afterprime.

Catch me here: https://www.afterprime.com
garyfritz

Re: What is the differance between an Indicator,EA,or Script

Post by garyfritz »

If you've already mixed them up, you may be in for a challenge. Without some good understanding of MQL, it's hard to tell the difference among the three. The folder they're in is the best clue.
snakedoctor
Posts: 3
Joined: Fri Nov 02, 2012 8:55 pm
Location: Jacksonville Beach, Florida USA

Re: What is the differance between an Indicator,EA,or Script

Post by snakedoctor »

Yep, My problem is I messed them up from the start. Some were copied from Forex Factory & other sites & put in the wrong folders. Others were in the right folder until I synced the experts folder with drop box. This ended up with duplicate directories in drop box. I guess you can see where this is going!
Well the good thing is they are just demo accounts. I can download an set up my real account unsynced. But, I would still like to know some way to tell the difference! Even if I had to look at the code!
garyfritz

Re: What is the differance between an Indicator,EA,or Script

Post by garyfritz »

Search for SetIndexBuffer -- if you find that, it's an indicator.

Search for OrderSend -- if you find that, it's an EA. (Or it could be a script. I actually don't know how to tell a script and an EA apart... :oops:)

That should cover most cases.
snakedoctor
Posts: 3
Joined: Fri Nov 02, 2012 8:55 pm
Location: Jacksonville Beach, Florida USA

Re: What is the differance between an Indicator,EA,or Script

Post by snakedoctor »

garyfritz wrote:Search for SetIndexBuffer -- if you find that, it's an indicator.

Search for OrderSend -- if you find that, it's an EA. (Or it could be a script. I actually don't know how to tell a script and an EA apart... :oops:)

That should cover most cases.

Thanks, Gary That will give me something to work on!
User avatar
gaheitman
Trader
Posts: 655
Joined: Tue Nov 15, 2011 10:55 pm
Location: Richmond, VA, US

Re: What is the differance between an Indicator,EA,or Script

Post by gaheitman »

garyfritz wrote:Search for SetIndexBuffer -- if you find that, it's an indicator.

Search for OrderSend -- if you find that, it's an EA. (Or it could be a script. I actually don't know how to tell a script and an EA apart... :oops:)

That should cover most cases.
Scripts generally don't have init() / deinit() procedures.

George
garyfritz

Re: What is the differance between an Indicator,EA,or Script

Post by garyfritz »

That's what I thought too, but I checked several and they DID have 'em.

Why wouldn't/shouldn't scripts need init/deinit?
User avatar
gaheitman
Trader
Posts: 655
Joined: Tue Nov 15, 2011 10:55 pm
Location: Richmond, VA, US

Re: What is the differance between an Indicator,EA,or Script

Post by gaheitman »

garyfritz wrote:That's what I thought too, but I checked several and they DID have 'em.

Why wouldn't/shouldn't scripts need init/deinit?
Because by definition they are supposed to run once. EAs are triggered on incoming ticks, so naturally loop through start() again and again. Init/deinit gives you a place outside of that loop to set things up and tear them down. Well, that's why I would have done it. ;)

Can you confirm the init() is being called in the script? I checked some of mine and they didn't have them. The template that metaeditor starts with for scripts doesn't have them either.

Code: Select all

//+------------------------------------------------------------------+
//|                                                     testeede.mq4 |
//|                                 Copyright © 2012, George Heitman |
//|                                        http://www.metaquotes.net |
//+------------------------------------------------------------------+
#property copyright "Copyright © 2012, George Heitman"
#property link      "http://www.metaquotes.net"

//+------------------------------------------------------------------+
//| script program start function                                    |
//+------------------------------------------------------------------+
int start()
  {
//----
   
//----
   return(0);
  }
//+------------------------------------------------------------------+
George
garyfritz

Re: What is the differance between an Indicator,EA,or Script

Post by garyfritz »

Yup, it's called. The "10.2a DP BUY/SELL" scripts that somebody (Steve?) wrote a while ago have init(). It calls a message box from init() to see if you want to use the script. I double-checked it by adding a Comment() at the end of init().

If you put an EA into the scripts directory, would it act like a script? The code seems to be about the same so I'm guessing the different behavior must be driven by the different location.
Post Reply

Return to “General Forex Discussion”