|
|||||||
| 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 | Thread Tools | Display Modes |
|
|||
|
Quote:
Quote:
|
|
|||
|
I think it is the number of the bars which was not changed after the last indicator's call.
For example we had 300 bars. Then EA may call indicator for the signal or to open the order. For example: H1 timeframe. So we still have 300 unchanged bars. Because 301th bar is open bar and this bar will not be counted. Because many indicators and EAs are calculated using i bars so using this function we may be sure that this i number of bars was unchanged and indicator will not re-paint and everything will be on close bar. It is example in help file: Code:
int start()
{
int limit;
int counted_bars=IndicatorCounted();
//----
if(counted_bars>0) counted_bars--;
limit=Bars-counted_bars;
//----
for(int i=0; i<limit; i++)
{
//----
ExtBlueBuffer[i]=iMA(NULL,0,JawsPeriod,0,MODE_SMMA,PRICE_MEDIAN,i);
ExtRedBuffer[i]=iMA(NULL,0,TeethPeriod,0,MODE_SMMA,PRICE_MEDIAN,i);
ExtLimeBuffer[i]=iMA(NULL,0,LipsPeriod,0,MODE_SMMA,PRICE_MEDIAN,i);
}
//----
return(0);
}
Last edited by newdigital : 07-22-2007 at 02:42 PM. |
|
|||
|
Thank You guys, I have one more question please:
I spent many hours, and I cannot solve the problem to this code: if (MODE_ASK==121.10) { ticket=OrderSend(Symbol().............. I want the USD\JPY to trigger a buy at this point. What's wrong with this code? Can somebody tell me a code syntax that will trigger a buy at a certain time? Thank You. God bless You. |
|
|||
|
MQL4 Learning
I spent many hours, and I cannot solve the problem to this code:
if (MODE_ASK==121.10) { ticket=OrderSend(Symbol().............. I want the USD\JPY to trigger a buy at this point. What's wrong with this code? Also, can someone tell me a code syntax that will trigger a buy at a certain time? Thank You. God bless You. |
|
|||
|
Please not that I am not a coder so my opinion about how to code may be totally mistaken.
I just opened help in MetaEditor: Code:
int OrderSend( string symbol, int cmd, double volume, double price, int slippage, double stoploss, double takeprofit, string comment=NULL, int magic=0, datetime expiration=0, color arrow_color=CLR_NONE) - cmd - OP_BUY (buy), or OP_SELL (sell), and so on; And also use MarketInfo. Besices you may use some templates to create EAs: Templates to create EAs and Indicators: - some good templates are here; - templates with some new codes are here. - Programming Modules with many programming functions are here. As to open the order at a certain time so you may use something like that: Code:
datetime OpenOrder = StrToTime(TimeTrade) Code:
if(CurTime() >= OpenTime && TimeCurrent() <= OpenOrder+60) extern string TimeTrade = "11:31"; datetime, StrToTime and TimeCurrent - see help in MetaEditor; |
|
|||
|
MQL4,
I see that Codersguru replied already so forget about my post. Just want to say that we are having this thread http://www.forex-tsd.com/general-dis...ing-forum.html as well. |
![]() |
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Learning Cycles For New Traders | Dan7974 | General Discussion | 350 | 01-18-2008 06:04 PM |
| Learning to code for autotrading | GoatT | Metatrader Programming | 8 | 01-10-2007 08:55 PM |
| Self learning expert | mrtools | Expert Advisors - Metatrader 4 | 32 | 10-22-2006 05:29 PM |