A little help with EA code using icustom please - MetaQuotes MetaTrader MQL Programming | futures io social day trading
futures io futures trading

A little help with EA code using icustom please
Updated: Views / Replies:800 / 1
Created: by ryangillespie Attachments:2

Welcome to futures io.

(If you already have an account, login at the top of the page)

futures io is the largest futures trading community on the planet, with over 90,000 members. At futures io, our goal has always been and always will be to create a friendly, positive, forward-thinking community where members can openly share and discuss everything the world of trading has to offer. The community is one of the friendliest you will find on any subject, with members going out of their way to help others. Some of the primary differences between futures io and other trading sites revolve around the standards of our community. Those standards include a code of conduct for our members, as well as extremely high standards that govern which partners we do business with, and which products or services we recommend to our members.

At futures io, our focus is on quality education. No hype, gimmicks, or secret sauce. The truth is: trading is hard. To succeed, you need to surround yourself with the right support system, educational content, and trading mentors Ė all of which you can find on futures io, utilizing our social trading environment.

With futures io, you can find honest trading reviews on brokers, trading rooms, indicator packages, trading strategies, and much more. Our trading review process is highly moderated to ensure that only genuine users are allowed, so you donít need to worry about fake reviews.

We are fundamentally different than most other trading sites:
  • We are here to help. Just let us know what you need.
  • We work extremely hard to keep things positive in our community.
  • We do not tolerate rude behavior, trolling, or vendors advertising in posts.
  • We firmly believe in and encourage sharing. The holy grail is within you, we can help you find it.
  • We expect our members to participate and become a part of the community. Help yourself by helping others.

You'll need to register in order to view the content of the threads and start contributing to our community.  It's free and simple.

-- Big Mike, Site Administrator

Thread Tools Search this Thread

A little help with EA code using icustom please

  #1 (permalink)
Elite Member
london, England
Futures Experience: Intermediate
Platform: Ninjatrader
Favorite Futures: CL
ryangillespie's Avatar
Posts: 34 since Nov 2011
Thanks: 9 given, 1 received

A little help with EA code using icustom please

Hi all,

I am trying to learn how to programme my own expert advisor, i am sure you will all be shocked at how simple this code is but I am learning so please help me and point out where I am going wrong.

I have an indicator that I use, super_signals_v2_Alert.mq4, this paints green or red buy and sell signals and then sound an alert. When a green signal is painted I would like to open a long market order at the open of the next bar.

When a red signal is painted I would like to open a shoprt market entry at the open of the next bar.

If a long position is open and anotherr signal is painted in the same direction, it is ignored, only 1 trade open in any direction at any time.

If an opposing signal sounds then this closes the trade. I would like to have an option to have the EA always in the market so reverse when an opposing signal is triggered.

I have been trying to get this right but I am having no luck...

Here is what I have so far but I am not sure if the condition to open and close is correct as per the indicator as it doesnt open trades when the indicator alarms, it only buys and opens multiple trades in the same direction.

#include <stdlib.mqh>

extern double downtrend;// downtrend=iCustom(NULL,0,"super_signals_v2_alert",1,0); ???
extern double uptrend; // uptrend=iCustom(NULL,0,"super_signals_v2_alert",0,0); ???
extern int dist2=21;
extern int SignalBar=1;
input double lots=3;
input double TakeProfit=550;
int OpenOrders=0, cnt=0;

int start()


int downtrend = iHighest(NULL,0,MODE_HIGH,dist2,SignalBar-dist2/2);
int uptrend = iLowest(NULL,0,MODE_LOW,dist2,SignalBar-dist2/2);

if(downtrend && OpenOrders<1)
bool ticket=OrderSend(Symbol(),OP_SELL,lots,Bid,3,0,Bid+TakeProfit*Point,NULL,0,0,clrRed);
else if(uptrend && OpenOrders<1)


Can someone please help me out here, it would be greatly appreciated.


Attached Files
Register to download File Type: mq4 tester.mq4 (1.2 KB, 4 views)
Register to download File Type: mq4 super_signals_v2_Alert.mq4 (2.7 KB, 5 views)
Reply With Quote
  #2 (permalink)
Quick Summary
Quick Summary Post

Quick Summary is created and edited by users like you... Add FAQ's, Links and other Relevant Information by clicking the edit button in the lower right hand corner of this message.


futures io > > > > > A little help with EA code using icustom please

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Upcoming Webinars and Events (4:30PM ET unless noted)

Wyckoff Hunting for Great Risk/Reward Ratio w/Gary Fullett

Elite only

Digging into the Details of iSystems w/Stage 5 & iSystems

Jun 5

Similar Threads
Thread Thread Starter Forum Replies Last Post
closed manually or by ea ankityadav MetaTrader 2 August 24th, 2013 08:59 PM
mt4 ea to ninjatrader quangcao NinjaTrader Programming 1 August 14th, 2013 11:50 AM
Break even 'EA' yoav3211 MetaTrader 1 October 26th, 2012 07:24 PM
EA developers for MultiCharts ATS Expert LMAX MultiCharts 2 August 18th, 2011 06:24 AM

All times are GMT -4. The time now is 08:16 AM.

Copyright © 2018 by futures io, s.a., Av Ricardo J. Alfaro, Century Tower, Panama, +507 833-9432, info@futures.io
All information is for educational use only and is not investment advice.
There is a substantial risk of loss in trading commodity futures, stocks, options and foreign exchange products. Past performance is not indicative of future results.
no new posts
Page generated 2018-05-20 in 0.07 seconds with 20 queries on phoenix via your IP