Forex
Google
New signals service!

Go Back   Forex Trading > Metatrader Training > Metatrader 4 mql 4 - Development course > Questions


Register in Forex TSD!
Trading Systems Leaders in this forum (automated trading systems) are winning more than 3000 pips in a month (30000$ investing one lot every time).
Click here to register and get more information

Reply
 
LinkBack Thread Tools Display Modes
  #51 (permalink)  
Old 05-15-2008, 12:42 AM
Junior Member
 
Join Date: May 2008
Posts: 26
payback is on a distinguished road
sorry! but thx anyway!
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #52 (permalink)  
Old 05-16-2008, 07:08 PM
Junior Member
 
Join Date: Feb 2008
Posts: 4
linalm is on a distinguished road
Question Help please ... iStochastics and iCustom returning wrong values


Hi everyone,

I am running into some issues using the iStochastic function as well as the iCustom function and am hoping you can help me. With either function, the values that I get do not match those that I see on the chart for either the stochastic indicator or my own indicator that I am calling with the iCustom function.

What could the reason be and how can I solve this? I appreciate your assistance and thank you in advance.

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #53 (permalink)  
Old 05-18-2008, 12:30 AM
cockeyedcowboy's Avatar
Senior Member
 
Join Date: Nov 2005
Posts: 312
cockeyedcowboy is on a distinguished road
Quote:
Originally Posted by linalm View Post
Hi everyone,

I am running into some issues using the iStochastic function as well as the iCustom function and am hoping you can help me. With either function, the values that I get do not match those that I see on the chart for either the stochastic indicator or my own indicator that I am calling with the iCustom function.

What could the reason be and how can I solve this? I appreciate your assistance and thank you in advance.
I have had some problems will the iCustom returning different values when used with the NormalizeDouble() function.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #54 (permalink)  
Old 05-29-2008, 04:29 AM
sonicdeejay's Avatar
Member
 
Join Date: Apr 2008
Posts: 99
sonicdeejay is on a distinguished road
Quote:
double Buy1_1 = iCustom(NULL, 0, "i_Trend", 0, 0, 0, 20, 2, 13, 300, 0, 0);
double Buy1_2 = iCustom(NULL, 0, "i_Trend", 0, 0, 0, 20, 2, 13, 300, 1, 0);
May I know what is the diff between these 0 and 1...

I have checked here but do not seem to understand...

iCustom - MQL4 Documentation


Thx in advacned
sonic
__________________
~It's not who I am underneath but, what I do that defines me!!

My FOREX Journal
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #55 (permalink)  
Old 05-29-2008, 04:38 AM
Senior Member
 
Join Date: Feb 2007
Posts: 881
FerruFx is on a distinguished road
Quote:
Originally Posted by sonicdeejay View Post
May I know what is the diff between these 0 and 1...

I have checked here but do not seem to understand...

iCustom - MQL4 Documentation


Thx in advacned
sonic
These are the buffers # from the iTrend indicator you call.

FerruFx
__________________
THE HEART of FOREX & THE PROBABILITY METER - Trade with 100% confidence and ... Stress Less!!!
Coding services: Experts Advisors, indicators, alerts, etc ... more info by PM
NEW: video presentation of the Probability Meter ... 24hrs action on the website
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #56 (permalink)  
Old 06-07-2008, 04:36 AM
sonicdeejay's Avatar
Member
 
Join Date: Apr 2008
Posts: 99
sonicdeejay is on a distinguished road
I am want to write a EA write using this Advanced ADX indicator...How can I extract the value and color from the indicator...



Buy
ADX color green and (ADX this hour> ADX previous hour)



Sell
ADX color red and (ADX this hour< ADX previous hour)

I have tried out abit in coding on my own. The coding correct with my rule??Help me out here??


thx
sonic


PHP Code:
for (Bars 205>= 0--)
   {
   
  
double adx1         =iCustom(NULL0"Advanced_ADX",13,0,i); 
  
double adx2         =iCustom(NULL0"Advanced_ADX",13,1,i); 
  
   if ((
adx1[i]>adx2[i])&&(adx1[i+1] > adx1[i]) // BUY 
      
BUY routine}
   
   if ((
adx1[i]<adx2[i])&&(adx1[i+1] < adx1[i]) // SELL  
      
SELL routine}


Attached Images
File Type: gif advanced_adx_1.gif (16.1 KB, 87 views)
Attached Files
File Type: mq4 Advanced_ADX.mq4 (2.2 KB, 15 views)
__________________
~It's not who I am underneath but, what I do that defines me!!

My FOREX Journal

Last edited by sonicdeejay; 06-07-2008 at 10:05 AM.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #57 (permalink)  
Old 07-28-2008, 09:57 AM
cooltrader28@yahoo.com's Avatar
Member
 
Join Date: Dec 2007
Posts: 33
cooltrader28@yahoo.com is on a distinguished road
ICustom Indicator EA

Code:
//+------------------------------------------------------------------+
//| This MQL is generated by Expert Advisor Builder                  |
//|                http://sufx.core.t3-ism.net/ExpertAdvisorBuilder/ |
//|                                                                  |
//|  In no event will author be liable for any damages whatsoever.   |
//|                                         |
//|                                                                  |
//+------------------- DO NOT REMOVE THIS HEADER --------------------+

#define SIGNAL_NONE 0
#define SIGNAL_BUY   1
#define SIGNAL_SELL  2
#define SIGNAL_CLOSEBUY 3
#define SIGNAL_CLOSESELL 4

#property copyright "Expert Advisor Builder"
#property link      "http://sufx.core.t3-ism.net/ExpertAdvisorBuilder/"

extern int MagicNumber = 0;
extern bool SignalMail = False;
extern bool EachTickMode = True;
extern double Lots = 0.2;
extern int Slippage = 3;
extern bool UseStopLoss = True;
extern int StopLoss = 27;
extern bool UseTakeProfit = True;
extern int TakeProfit = 34;
extern bool UseTrailingStop = False;
extern int TrailingStop = 30;

int BarCount;
int Current;
bool TickCheck = False;
//+------------------------------------------------------------------+
//| expert initialization function                                   |
//+------------------------------------------------------------------+
int init() {
   BarCount = Bars;

   if (EachTickMode) Current = 0; else Current = 1;

   return(0);
}
//+------------------------------------------------------------------+
//| expert deinitialization function                                 |
//+------------------------------------------------------------------+
int deinit() {
   return(0);
}
//+------------------------------------------------------------------+
//| expert start function                                            |
//+------------------------------------------------------------------+
int start() {
   int Order = SIGNAL_NONE;
   int Total, Ticket;
   double StopLossLevel, TakeProfitLevel;



   if (EachTickMode && Bars != BarCount) TickCheck = False;
   Total = OrdersTotal();
   Order = SIGNAL_NONE;

   //+------------------------------------------------------------------+
   //| Variable Begin                                                   |
   //+------------------------------------------------------------------+


double Buy1_1 = iOBV(NULL, 0, PRICE_LOW, Current + 0);
double Buy1_2 = iCustom(NULL, 0, "synthetic_", 22, 0, Current + 0);

double Sell1_1 = iOBV(NULL, 0, PRICE_HIGH, Current + 0);
double Sell1_2 = iCustom(NULL, 0, "synthetic_", 22, 0, Current + 0);



   
   //+------------------------------------------------------------------+
   //| Variable End                                                     |
   //+------------------------------------------------------------------+

   //Check position
   bool IsTrade = False;

   for (int i = 0; i < Total; i ++) {
      OrderSelect(i, SELECT_BY_POS, MODE_TRADES);
      if(OrderType() <= OP_SELL &&  OrderSymbol() == Symbol()) {
         IsTrade = True;
         if(OrderType() == OP_BUY) {
            //Close

            //+------------------------------------------------------------------+
            //| Signal Begin(Exit Buy)                                           |
            //+------------------------------------------------------------------+

            

            //+------------------------------------------------------------------+
            //| Signal End(Exit Buy)                                             |
            //+------------------------------------------------------------------+

            if (Order == SIGNAL_CLOSEBUY && ((EachTickMode && !TickCheck) || (!EachTickMode && (Bars != BarCount)))) {
               OrderClose(OrderTicket(), OrderLots(), Bid, Slippage, MediumSeaGreen);
               if (SignalMail) SendMail("[Signal Alert]", "[" + Symbol() + "] " + DoubleToStr(Bid, Digits) + " Close Buy");
               if (!EachTickMode) BarCount = Bars;
               IsTrade = False;
               continue;
            }
            //Trailing stop
            if(UseTrailingStop && TrailingStop > 0) {                 
               if(Bid - OrderOpenPrice() > Point * TrailingStop) {
                  if(OrderStopLoss() < Bid - Point * TrailingStop) {
                     OrderModify(OrderTicket(), OrderOpenPrice(), Bid - Point * TrailingStop, OrderTakeProfit(), 0, MediumSeaGreen);
                     if (!EachTickMode) BarCount = Bars;
                     continue;
                  }
               }
            }
         } else {
            //Close

            //+------------------------------------------------------------------+
            //| Signal Begin(Exit Sell)                                          |
            //+------------------------------------------------------------------+

            

            //+------------------------------------------------------------------+
            //| Signal End(Exit Sell)                                            |
            //+------------------------------------------------------------------+

            if (Order == SIGNAL_CLOSESELL && ((EachTickMode && !TickCheck) || (!EachTickMode && (Bars != BarCount)))) {
               OrderClose(OrderTicket(), OrderLots(), Ask, Slippage, DarkOrange);
               if (SignalMail) SendMail("[Signal Alert]", "[" + Symbol() + "] " + DoubleToStr(Ask, Digits) + " Close Sell");
               if (!EachTickMode) BarCount = Bars;
               IsTrade = False;
               continue;
            }
            //Trailing stop
            if(UseTrailingStop && TrailingStop > 0) {                 
               if((OrderOpenPrice() - Ask) > (Point * TrailingStop)) {
                  if((OrderStopLoss() > (Ask + Point * TrailingStop)) || (OrderStopLoss() == 0)) {
                     OrderModify(OrderTicket(), OrderOpenPrice(), Ask + Point * TrailingStop, OrderTakeProfit(), 0, DarkOrange);
                     if (!EachTickMode) BarCount = Bars;
                     continue;
                  }
               }
            }
         }
      }
   }

   //+------------------------------------------------------------------+
   //| Signal Begin(Entry)                                              |
   //+------------------------------------------------------------------+

   if (Buy1_1 != Buy1_2) Order = SIGNAL_BUY;

   if (Sell1_1 != Sell1_2) Order = SIGNAL_SELL;


   //+------------------------------------------------------------------+
   //| Signal End                                                       |
   //+------------------------------------------------------------------+

   //Buy
   if (Order == SIGNAL_BUY && ((EachTickMode && !TickCheck) || (!EachTickMode && (Bars != BarCount)))) {
      if(!IsTrade) {
         //Check free margin
         if (AccountFreeMargin() < (1000 * Lots)) {
            Print("We have no money. Free Margin = ", AccountFreeMargin());
            return(0);
         }

         if (UseStopLoss) StopLossLevel = Ask - StopLoss * Point; else StopLossLevel = 0.0;
         if (UseTakeProfit) TakeProfitLevel = Ask + TakeProfit * Point; else TakeProfitLevel = 0.0;

         Ticket = OrderSend(Symbol(), OP_BUY, Lots, Ask, Slippage, StopLossLevel, TakeProfitLevel, "Buy(#" + MagicNumber + ")", MagicNumber, 0, DodgerBlue);
         if(Ticket > 0) {
            if (OrderSelect(Ticket, SELECT_BY_TICKET, MODE_TRADES)) {
				Print("BUY order opened : ", OrderOpenPrice());
                if (SignalMail) SendMail("[Signal Alert]", "[" + Symbol() + "] " + DoubleToStr(Ask, Digits) + " Open Buy");
			} else {
				Print("Error opening BUY order : ", GetLastError());
			}
         }
         if (EachTickMode) TickCheck = True;
         if (!EachTickMode) BarCount = Bars;
         return(0);
      }
   }

   //Sell
   if (Order == SIGNAL_SELL && ((EachTickMode && !TickCheck) || (!EachTickMode && (Bars != BarCount)))) {
      if(!IsTrade) {
         //Check free margin
         if (AccountFreeMargin() < (1000 * Lots)) {
            Print("We have no money. Free Margin = ", AccountFreeMargin());
            return(0);
         }

         if (UseStopLoss) StopLossLevel = Bid + StopLoss * Point; else StopLossLevel = 0.0;
         if (UseTakeProfit) TakeProfitLevel = Bid - TakeProfit * Point; else TakeProfitLevel = 0.0;

         Ticket = OrderSend(Symbol(), OP_SELL, Lots, Bid, Slippage, StopLossLevel, TakeProfitLevel, "Sell(#" + MagicNumber + ")", MagicNumber, 0, DeepPink);
         if(Ticket > 0) {
            if (OrderSelect(Ticket, SELECT_BY_TICKET, MODE_TRADES)) {
				Print("SELL order opened : ", OrderOpenPrice());
                if (SignalMail) SendMail("[Signal Alert]", "[" + Symbol() + "] " + DoubleToStr(Bid, Digits) + " Open Sell");
			} else {
				Print("Error opening SELL order : ", GetLastError());
			}
         }
         if (EachTickMode) TickCheck = True;
         if (!EachTickMode) BarCount = Bars;
         return(0);
      }
   }

   if (!EachTickMode) BarCount = Bars;

   return(0);
}
//+----------------------------------------------------------------

hello


this is my startegy

double Buy1_1 = iOBV(NULL, 0, PRICE_LOW, Current + 0);
double Buy1_2 = iCustom(NULL, 0, "synthetic_", 22, 0, Current + 0);

double Sell1_1 = iOBV(NULL, 0, PRICE_HIGH, Current + 0);
double Sell1_2 = iCustom(NULL, 0, "synthetic_", 22, 0, Current + 0);



i want when my custom indicator crosses the obv line sell or buy the market

but

it dont work


what is wrong in the code ?_





Last edited by cooltrader28@yahoo.com; 07-28-2008 at 10:02 AM.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply

Bookmarks

Tags
icustom

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Easy iCustom and Alerts! codersguru Indicators - Metatrader 4 50 09-18-2008 01:02 PM
iCustom question .. yaniv_av Indicators - Metatrader 4 16 06-20-2008 04:37 PM
icustom maje Questions 24 12-05-2007 09:26 AM
I need help on creating an Icustom statement for my EA using this indicator as input! iscuba11 Expert Advisors - Metatrader 4 4 09-11-2006 07:18 PM
iCustom() problem billritz Indicators - Metatrader 4 5 08-23-2006 07:22 AM


All times are GMT. The time now is 07:23 PM.



Search Engine Friendly URLs by vBSEO 3.2.0 ©2008, Crawlability, Inc.