|
|||||||
| 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 |
|
![]() |
|
|
LinkBack (2) | Thread Tools | Display Modes |
|
|||
|
Ask????
Hi All,
EA is opening 2 positions at the same time, same pairs. Could u please check this. Thanks, Bongo int cnt = 0; string OrderValueSymbol(int index) { OrderSelect(index, SELECT_BY_POS); return(OrderSymbol()); } int start() { if( Bars < 20 ) return(0); for(cnt=1;cnt<=OrdersTotal();cnt++) { if( OrderValueSymbol(cnt) == Symbol() ) { Order = 1; break; } else { Order = 0; } } if( OrdersTotal() == 0 ) Order = 0; if( OrdersTotal() < 5 && Order == 0 ) etc.... |
|
|||
|
Hi Dave,
Getting an error message when I try to compile, obviously I am missing something. Message below 'indicator_color2' - defined value expected E:\Program Files\MetaTrader 4\experts\indicators\Heiken Ashi.mq4 (18, 1) Gordon |
|
||||
|
Quote:
![]()
__________________
David Michael H "Trader helps traders with sincerity, honesty and integrity" |
|
||||
|
Quote:
__________________
David Michael H "Trader helps traders with sincerity, honesty and integrity" |
|
|||
|
Thanks again Dave,
Blue for buy, red for sell. #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 blue #property indicator_color3 Red #property indicator_color4 blue //---- buffers double ExtMapBuffer1[]; double ExtMapBuffer2[]; double ExtMapBuffer3[]; double ExtMapBuffer4[]; //---- int ExtCountedBars=0; //+------------------------------------------------------------------+ //| Custom indicator initialization function | //|------------------------------------------------------------------| int init() { //---- indicators SetIndexStyle(0,DRAW_HISTOGRAM, 0, 1, Red); SetIndexBuffer(0, ExtMapBuffer1); SetIndexStyle(1,DRAW_HISTOGRAM, 0, 1, blue); SetIndexBuffer(1, ExtMapBuffer2); SetIndexStyle(2,DRAW_HISTOGRAM, 0, 3, Red); SetIndexBuffer(2, ExtMapBuffer3); SetIndexStyle(3,DRAW_HISTOGRAM, 0, 3, blue); SetIndexBuffer(3, ExtMapBuffer4); //---- 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 haOpen, haHigh, haLow, haClose; if(Bars<=10) return(0); ExtCountedBars=IndicatorCounted(); //---- check for possible errors if (ExtCountedBars<0) return(-1); //---- last counted bar will be recounted if (ExtCountedBars>0) ExtCountedBars--; 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(haOpen, haClose)); haLow=MathMin(Low[pos], MathMin(haOpen, haClose)); 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); Gordon |
|
||||
|
Quote:
Also, are you using custom functions? Cheers!
__________________
"Anyone who has never made a mistake has never tried anything new." -Albert Einstein |
|
||||
|
Quote:
![]()
__________________
David Michael H "Trader helps traders with sincerity, honesty and integrity" |
|
|||
|
hi gang,
i thought this will be the right place to ask this. how can i refresh the charts from code? or how can i refresh indicators from their code? i ask this because some indicators plot ...and then when i click on refresh..change their values a bit. thanks for the help. regards |
|
|||
|
Hi to all. Im new here, VERY NICE FORUM!!!!
I have a doubt, i want to color my bars acording to this criteria: I have this Inverse fisher transform of RSI indicator witch i want to use to color the bars blue when its increasing, and red when its decreasing... Ill try to attach the indicator i case of someone could help me.. Thanks, LC. |
![]() |
| Thread Tools | |
| Display Modes | |
|
|
LinkBacks (?)
LinkBack to this Thread: http://www.forex-tsd.com/questions/270-ask.html
|
|||
| Posted By | For | Type | Date |
| OzFx System:) - Page 639 | This thread | Refback | 06-21-2008 09:53 PM |
| Forex SRDC Sidus Sibkis EA MT4 Forum OTCSmart | This thread | Refback | 12-08-2007 11:46 AM |