Forex
Google
New signals service!

Go Back   Forex Trading > Programming > Metatrader Programming


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
  #141 (permalink)  
Old 07-30-2007, 04:22 AM
Member
 
Join Date: Jul 2007
Posts: 41
MQL4 is on a distinguished road
Smile

That's smart!

Very smart!!!

But could you please show me how to imply it to the code?An example perhaps?

PHP Code:
Print("Parameter X is ",X," and should be XXX"); 
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #142 (permalink)  
Old 07-30-2007, 04:39 AM
Senior Member
 
Join Date: Dec 2006
Location: Ukraine
Posts: 491
Shinigami is on a distinguished road
Quote:
Originally Posted by MQL4 View Post
That's smart!

Very smart!!!

But could you please show me how to imply it to the code?An example perhaps?

PHP Code:
Print("Parameter X is ",X," and should be XXX"); 
before OrderSend function I set
Print("Ask is ",Ask," and stoploss will be ",sl," and takeprofit will be ",tp);
I also set stoploss level and takeprofit level before that.
Like this:
sl=Bid-SL*Point;
tp=Bid+TP*Point;
and only after I put print...
__________________
MQL4 programming is easy ^^
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #143 (permalink)  
Old 07-30-2007, 06:39 AM
Member
 
Join Date: Jul 2007
Posts: 41
MQL4 is on a distinguished road
Thanks Shinigami,

Can You put the code inside the Heinki Ashi, I have no idea where to put it. I tried already. Here is the code for heinki ashi:

Thanks Shinigami, You are awesome!!!
PHP Code:
//+------------------------------------------------------------------+
//|                                                  Heiken Ashi.mq4 |
//|                      Copyright c 2004, MetaQuotes Software Corp. |
//|                                        http://www.metaquotes.net |
//+------------------------------------------------------------------+
//| For Heiken Ashi we recommend next chart settings ( press F8 or   |
//| select on menu 'Charts'->'Properties...'):                       |
//|  - On 'Color' Tab select 'Black' for 'Line Graph'                |
//|  - On 'Common' Tab disable 'Chart on Foreground' checkbox and    |
//|    select 'Line Chart' radiobutton                               |
//+------------------------------------------------------------------+
#property copyright "Copyright © 2004, MetaQuotes Software Corp."
#property link      "http://www.metaquotes.net"

#property indicator_chart_window
#property indicator_buffers 4
#property indicator_color1 Red
#property indicator_color2 White
#property indicator_color3 Red
#property indicator_color4 White
#property indicator_width1 1
#property indicator_width2 1
#property indicator_width3 3
#property indicator_width4 3

//----
extern color color1 Red;
extern color color2 White;
extern color color3 Red;
extern color color4 White;
//---- buffers
double ExtMapBuffer1[];
double ExtMapBuffer2[];
double ExtMapBuffer3[];
double ExtMapBuffer4[];
//----
int ExtCountedBars=0;
//+------------------------------------------------------------------+
//| Custom indicator initialization function                         |
//|------------------------------------------------------------------|
int init()
  {
//---- indicators
   
SetIndexStyle(0,DRAW_HISTOGRAM01color1);
   
SetIndexBuffer(0ExtMapBuffer1);
   
SetIndexStyle(1,DRAW_HISTOGRAM01color2);
   
SetIndexBuffer(1ExtMapBuffer2);
   
SetIndexStyle(2,DRAW_HISTOGRAM03color3);
   
SetIndexBuffer(2ExtMapBuffer3);
   
SetIndexStyle(3,DRAW_HISTOGRAM03color4);
   
SetIndexBuffer(3ExtMapBuffer4);
//----
   
SetIndexDrawBegin(0,10);
   
SetIndexDrawBegin(1,10);
   
SetIndexDrawBegin(2,10);
   
SetIndexDrawBegin(3,10);
//---- indicator buffers mapping
   
SetIndexBuffer(0,ExtMapBuffer1);
   
SetIndexBuffer(1,ExtMapBuffer2);
   
SetIndexBuffer(2,ExtMapBuffer3);
   
SetIndexBuffer(3,ExtMapBuffer4);
//---- initialization done
   
return(0);
  }
//+------------------------------------------------------------------+
//| Custom indicator deinitialization function                       |
//+------------------------------------------------------------------+
int deinit()
  {
//---- TODO: add your code here
   
//----
   
return(0);
  }
//+------------------------------------------------------------------+
//| Custom indicator iteration function                              |
//+------------------------------------------------------------------+
int start()
  {
   
double haOpenhaHighhaLowhaClose;
   if(
Bars<=10) return(0);
   
ExtCountedBars=IndicatorCounted();
//---- check for possible errors
   
if (ExtCountedBars<0) return(-1);
//---- last counted bar will be recounted
   
if (ExtCountedBars>0ExtCountedBars--;
   
int pos=Bars-ExtCountedBars-1;
   while(
pos>=0)
     {
      
haOpen=(ExtMapBuffer3[pos+1]+ExtMapBuffer4[pos+1])/2;
      
haClose=(Open[pos]+High[pos]+Low[pos]+Close[pos])/4;
      
haHigh=MathMax(High[pos], MathMax(haOpenhaClose));
      
haLow=MathMin(Low[pos], MathMin(haOpenhaClose));
      if (
haOpen<haClose
        {
         
ExtMapBuffer1[pos]=haLow;
         
ExtMapBuffer2[pos]=haHigh;
        } 
      else
        {
         
ExtMapBuffer1[pos]=haHigh;
         
ExtMapBuffer2[pos]=haLow;
        } 
      
ExtMapBuffer3[pos]=haOpen;
      
ExtMapBuffer4[pos]=haClose;
        
pos--;
     }
//----
   
return(0);
  }
//+------------------------------------------------------------------+ 
MQL4.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #144 (permalink)  
Old 07-30-2007, 06:41 AM
Member
 
Join Date: Jul 2007
Posts: 41
MQL4 is on a distinguished road
Thank You Shinigami,
You are awesome!!!

It works fine for me
You are a very good programmer!!!
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #145 (permalink)  
Old 07-30-2007, 07:00 AM
Member
 
Join Date: Jul 2007
Posts: 41
MQL4 is on a distinguished road
Shinigami,

I need Your help:

Before, it was:
PHP Code:
extern double TakeProfit 20
Then, I changed it to

PHP Code:
extern double TakeProfit 400
And the parameters, the inputs for the EA still show 20!!!!!!!!!

What's the problem?


Thanks in advance.....


MQL4.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #146 (permalink)  
Old 07-30-2007, 12:11 PM
Senior Member
 
Join Date: Dec 2006
Location: Ukraine
Posts: 491
Shinigami is on a distinguished road
After you compiled EA and started testing it, its properties (settings) are written down into a file. You need to change them manually.
If you wrote TP = 400 in the EA, then it means you set default value to 400.
In order for the EA to use that value in strategy tester you need to set it in the EA settings. Or simply use default values (there is a button for that, but I have no idea what is it called, my MT4 is russian).
Anyway just change the value in the properties.
I also recommend you setting best values as default values - each time you compile an expert that is attached to a chart, default values are being used.

Quote:
Originally Posted by MQL4 View Post
Shinigami,

I need Your help:

Before, it was:
PHP Code:
extern double TakeProfit 20
Then, I changed it to

PHP Code:
extern double TakeProfit 400
And the parameters, the inputs for the EA still show 20!!!!!!!!!

What's the problem?


Thanks in advance.....


MQL4.
__________________
MQL4 programming is easy ^^
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #147 (permalink)  
Old 07-30-2007, 12:42 PM
Senior Member
 
Join Date: Dec 2006
Location: Ukraine
Posts: 491
Shinigami is on a distinguished road
Sorry, nope. Can't figure it out myself. I'm still bad with indicators.
__________________
MQL4 programming is easy ^^
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #148 (permalink)  
Old 07-30-2007, 03:24 PM
Member
 
Join Date: Jul 2007
Posts: 41
MQL4 is on a distinguished road
Anyone?????????
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #149 (permalink)  
Old 07-30-2007, 04:41 PM
Senior Member
 
Join Date: Feb 2006
Posts: 558
Michel is on a distinguished road
Quote:
Originally Posted by MQL4 View Post
Can someone code this?

On MT4, the default color of the bars are green, right?

Well, can someone make all of the bars green, and make the bars :

22:55 and 16:30 red?

Challenging, huh? Or maybe easy for You.


God Bless You all!!!

I love You!!! Thank You, I am so happy right now!!!

Thank You!!!
Please, read this: Coloring newly forming bar - Forex Trading Software Forum and this:Change Bar Color - Forex Trading Software Forum
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #150 (permalink)  
Old 07-30-2007, 05:02 PM
zupcon's Avatar
Senior Member
 
Join Date: Dec 2005
Location: Malta
Posts: 235
zupcon is on a distinguished road
Perhaps someone can modify this, It currently paints the bars red, at 22:50 and 16:30, but the other bars are still normal colors.

If I get chance I'll see if I can improve this for you.

regards
zu
Attached Files
File Type: mq4 Timebar.mq4 (3.7 KB, 18 views)
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply

Bookmarks

Tags
automated close order, close, eas, forex, learn mql4, learn mql4 video, mql4 learning, OrderCloseBy, profit, reach, secure profit function, T101_v1.11_orest_IBFXm.mq4

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
Learning Cycles For New Traders Dan7974 General Discussion 350 01-18-2008 07:04 PM
Learning to code for autotrading GoatT Metatrader Programming 8 01-10-2007 09:55 PM
Self learning expert mrtools Expert Advisors - Metatrader 4 32 10-22-2006 06:29 PM


All times are GMT. The time now is 08:04 PM.



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