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 (1) Thread Tools Display Modes
  #441 (permalink)  
Old 10-23-2007, 08:01 PM
Beno's Avatar
Senior Member
 
Join Date: Aug 2006
Location: London
Posts: 360
Beno is on a distinguished road
Gidday
I have been reading alot on these threads about the ashi indicators but how do I get the Heiken_Ashi_Smoothed to show an uptrend and downtrend it seems far more difficult than first thought do I need to create 4 variables 2 for up and 2 for down as in below

double hasOpenLong=iCustom(NULL,0,"Heiken_Ashi_Smoothed", MaMetod,MaPeriod,MaPeriod2,1,shift) ;
double hasCloseLong=iCustom(NULL,0,"Heiken_Ashi_Smoothed" ,MaMetod,MaPeriod,MaPeriod2,3,shift) ;
double hasOpenShort=iCustom(NULL,0,"Heiken_Ashi_Smoothed" ,MaMetod,MaPeriod,MaPeriod2,0,shift) ;
double hasCloseShort=iCustom(NULL,0,"Heiken_Ashi_Smoothed ",MaMetod,MaPeriod,MaPeriod2,2,shift) ;

Any help would be great

Cheers

Beno
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #442 (permalink)  
Old 10-24-2007, 01:25 AM
Junior Member
 
Join Date: Apr 2007
Posts: 13
dharsant is on a distinguished road
Variable Storage

I have an indicator that creates objects (arrows) during certain events on my chart.

Let's say 3 arrows have popped up on the 1 min chart, and then I click on 5min and back to 1min..... the arrows have disappeared!!!

Is this a variable storage problem? Here's some code...

PHP Code:
(aboveextern int arrowCount 1;

(if 
arrow should show)
 
ObjectCreate("Sniper ArrowDown"+arrowCountOBJ_ARROW0TimeCurrent(),Bid);
ObjectSet("Sniper ArrowDown"+arrowCount,OBJPROP_ARROWCODE,242);
ObjectSet("Sniper ArrowDown"+arrowCountOBJPROP_COLOR,Red);
ObjectSet("Sniper ArrowDown"+arrowCountOBJPROP_STYLESTYLE_SOLID);
ObjectSet("Sniper ArrowDown"+arrowCountOBJPROP_WIDTH1);
arrowCount++; 
Any ideas??
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #443 (permalink)  
Old 10-24-2007, 04:02 AM
wolfe's Avatar
Senior Member
 
Join Date: Jan 2006
Posts: 722
wolfe is on a distinguished road
Quote:
Originally Posted by dharsant View Post
Got it, thanks for the help!!!
Glad you figured it out.

I was just throwing some ideas, I wasn't sure if they would work or not.

I was thinking something like this so sound only played once:

bool Play_Sound;


if ((latestlatestmain >= 0) && (latestmain < 0))
{
Play_Sound=true;
}

if (Play_Sound==true)
{
PlaySound("alert2.wav");
Play_sound=false;
}

Maybe?
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #444 (permalink)  
Old 10-24-2007, 02:16 PM
Junior Member
 
Join Date: Apr 2007
Posts: 13
dharsant is on a distinguished road
Thanks Wolfe, I was thinking along those lines too,
I ended up using something similar but using an array!
Appreciated your time mate.

For anybody who might be able to help with my new problem posted above, it'd be much appreciated.

I'm trying to have it draw arrows on my chart during a certain event, which I can get done.

But somehow I'm storing and initiating the script wrongly, as the arrows that have previously been set on the chart does not stay there (they disappear) when I click to change Timeframes.

Any Ideas?
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #445 (permalink)  
Old 10-24-2007, 04:51 PM
Senior Member
 
Join Date: Oct 2006
Posts: 104
antone is on a distinguished road
Code one trade per certain time?

need help with a code?

heres how it works:
only open a certain # of order per time (lets say 3 am - 6 am) or day or week
will not open another trade even though it creates a signal within that time

Last edited by antone; 10-24-2007 at 05:01 PM.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #446 (permalink)  
Old 10-24-2007, 09:29 PM
Beno's Avatar
Senior Member
 
Join Date: Aug 2006
Location: London
Posts: 360
Beno is on a distinguished road
Here is the ea that I am having with and the indi's I have called it The Abyss due to that's where I am trying to learn to code. lol
I am currently looking into these 2 errors on this site and the MQL4: automated forex trading, strategy tester and custom indicators with MetaTrader site.

2007.10.24 21:22:24 1998.11.20 06:00 The Abyss GBPJPY,Daily: OrderSend error 130

2007.10.24 21:22:24 1998.11.20 06:00 The Abyss GBPJPY,Daily: invalid double number as parameter 6 for OrderSend function


Could some one please have a look at the code and let me know what I have done wrong and how I could fix it.

Any help would be great


Cheers


Beno
Attached Files
File Type: mq4 Heiken_Ashi_Smoothed.mq4 (4.2 KB, 8 views)
File Type: mq4 Slope Direction Line.mq4 (4.3 KB, 8 views)
File Type: mq4 TrendManager.mq4 (1.4 KB, 9 views)
File Type: mq4 The Abyss.mq4 (6.8 KB, 18 views)
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #447 (permalink)  
Old 10-26-2007, 06:43 AM
Senior Member
 
Join Date: Oct 2006
Posts: 104
antone is on a distinguished road
Quote:
Originally Posted by antone View Post
need help with a code?

heres how it works:
only open a certain # of order per time (lets say 3 am - 6 am) or day or week
will not open another trade even though it creates a signal within that time
so can anyone help me please?

example it will only trade one order in 5 am - 10 am but can trade again in another time..
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #448 (permalink)  
Old 10-28-2007, 03:42 PM
Beno's Avatar
Senior Member
 
Join Date: Aug 2006
Location: London
Posts: 360
Beno is on a distinguished road
When using icustom in an EA how do you determine which buffers and index's to use. e.g. if I was trying to get an up or down trend from silvertrend indicator or similar. I might not be using the right terminology but hopefully you get where I'm coming from.

#property indicator_chart_window
#property indicator_buffers 2
#property indicator_color1 Blue
#property indicator_color2 Red


//---- input parameters
extern int RISK=3;
extern int SSP=9;
extern int CountBars=350;

//---- buffers
double val1[];
double val2[];

//+------------------------------------------------------------------+
//| Custom indicator initialization function |
//+------------------------------------------------------------------+
int init()
{
string short_name;
//---- indicator line
IndicatorBuffers(2);
SetIndexStyle(0,DRAW_HISTOGRAM,0,2);
SetIndexStyle(1,DRAW_HISTOGRAM,0,2);
SetIndexBuffer(0,val1);
SetIndexBuffer(1,val2);
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #449 (permalink)  
Old 10-28-2007, 03:49 PM
Kalenzo's Avatar
Senior Member
 
Join Date: Dec 2005
Location: Bydgoszcz - Poland
Posts: 696
Kalenzo is on a distinguished road
for this codes it will be like that :
The buffer that is used is bolded. After the buffer we have the shift.

Code:
iCustom(NULL,0,"silvertrend",RISK,SSP,CountBars,0,0);
Or like this:

Code:
iCustom(NULL,0,"silvertrend",3,9,350,0,0);
Regards
Kale
__________________
You need proffesional mql coder? Contact me! I will help you!
........................................
http://www.fxservice.eu/
........................................
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #450 (permalink)  
Old 10-28-2007, 03:51 PM
Kalenzo's Avatar
Senior Member
 
Join Date: Dec 2005
Location: Bydgoszcz - Poland
Posts: 696
Kalenzo is on a distinguished road
Quote:
Originally Posted by antone View Post
so can anyone help me please?

example it will only trade one order in 5 am - 10 am but can trade again in another time..
It is very simple, You need to check order open time of last order in history and then check the day with TimeDay function. If it is today then do not trade.
__________________
You need proffesional mql coder? Contact me! I will help you!
........................................
http://www.fxservice.eu/
........................................
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply

Bookmarks

Tags
candle time, CHinGsMAroonCLK, coders guru, expert advisor, forex, how to code, I_XO_A_H, mechanical trading, trading

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

LinkBacks (?)
LinkBack to this Thread: http://www.forex-tsd.com/metatrader-programming/554-how-code.html
Posted By For Type Date
Need an experienced programmer? - Page 2 Post #0 Refback 09-24-2008 07:24 AM

Similar Threads
Thread Thread Starter Forum Replies Last Post
How to code this? iscuba11 Metatrader 4 mql 4 - Development course 1 08-03-2007 05:22 PM


All times are GMT. The time now is 09:23 AM.



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