| New signals service! | |
|
|||||||
| 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 |
|
|||
|
Very Simple Indicator
Hi Codersguru,
I have no experience with MQL4 language, but i need a very simple yet time saving indicator. I need to develope an indicator that will draw a horizontal line based on some arithmetic calculations. (ie. Like a camarilla indicator, except the lines do not need to be re-drawn or updated, they will be fixed). All i need is a simple example of how to do this in the coding, and I will be able to do the rest on my own. For example, { Line1 = 1+1 Draw Line1 } I know this sounds simple, but i just don't know how to do the initial setup and getting a horizontal line drawn on my chart. Of course there will be much more calculations and equations to this indicator, but a simple example and setup would be greatly appreciated. Thanks!! |
|
|||
|
I have a question:
This may require some additional programming that can't be done on MT. Not sure. Basically, I have an EA that both backtests and forward tests well in MT with Alpari data. On other broker's datafeeds, there is often a discrepancy between trades. Sometimes, if a trade is opened on Alpari, it may not be opened with a different broker or vice versa. Is it possible to write some kind of script that will execute trades on my broker's platform just after a trade is executed on Alpari's platform? For example, I get a signal to buy 2 lots of cable at 1.9450 on Alpari. The trade is executed. That same order is then entered on my live broker's platform a split second later. When a stop or t/p level is hit on Alpari and the trade is closed, that same trade is then closed on my live broker's platform. This is not a scalping system, so if there is a 2 pip discrepancy between the two prices, it's not a big deal. Does anyone know if this is possible, and if so, how do I go about doing it? Thank you. |
|
||||
|
Help with MTF xpMA
Codersguru,
Can you please check MTF capabilities of xpMA? Many Thanks, Pippt Please see post #364 at: Multi Timeframe Indicators |
|
||||
|
simple question but i can't figure it out. what math function in mql is used to round out a double value?
say for example, i've got 0.69 and i want the result to be .70. or if the value is .63 and the result would be .60. the mathceiling() and mathfloor() do not do the trick. |
|
|||
|
Hello everyone...
Thanks to CodersGuru and his excellent course, I am attempting to learn MQL4 by converting an indicator I wrote in MQL3. I have run into a snag and would appreciate some help... if someone could please tell me what I am doing wrong in the following code. The problem is in the 2 If statements... at line 78 & 79 //+------------------------------------------------------------------+ //| First_Indicator.mq4 | //| Codersguru | //| http://www.forex-tsd.com | //+------------------------------------------------------------------+ #property copyright "Codersguru" #property link "http://www.forex-tsd.com" #property indicator_chart_window #property indicator_buffers 8 #property indicator_color1 Red //---- buffers double ExtMapBuffer1[]; //----------------- Variable Declarations ----------------------+ int pos=0; double Pivot_Point = 0; double new_Pivot_Point =0; double prev_Pivot_Point=0; double Pivot_Factor=0; double LastClose=0; //+------------------------------------------------------------------+ //| Custom indicator initialization function | //+------------------------------------------------------------------+ int init() { //---- indicators SetIndexStyle(1,DRAW_LINE,STYLE_SOLID,1); SetIndexBuffer(0,ExtMapBuffer1); string short_name = "Pivot Line"; IndicatorShortName(short_name); return(1); } //+------------------------------------------------------------------+ //| Custor indicator deinitialization function | //+------------------------------------------------------------------+ int deinit() { return(0); } //+------------------------------------------------------------------+ //| Custom indicator iteration function | //+------------------------------------------------------------------+ int start() { int counted_bars=IndicatorCounted(); //---- check for possible errors if (counted_bars<0) return(-1); //---- last counted bar will be recounted if (counted_bars>0) counted_bars--; int cnt=Bars-counted_bars; //---- main calculation loop while(cnt >= 0) { LastClose = Close[cnt]; If (LastClose > Pivot_Point) //Line 78 If(new_Pivot_Point > prev_Pivot_Point) //Line 79 { prev_Pivot_Point = new_Pivot_Point; Pivot_Point = new_Pivot_Point; } ExtMapBuffer1[cnt]= Pivot_Point ; cnt--; } return(0); } These are the compiler messages - --------------------------------------------------------------- 'If' - function is not defined .....(78,10) 'If' - semicolon expected .....(79,13) 'If' - function is not defined ...(79, 13) '{' - semicolon expected ....(80, 13) ---------------------------------------------------------------- No matter what I do, I can't seem to come up with what the problem is... I know it is very simple, but it is escaping me... Thanks to all who can assist in this basic question.... Chief P.S. Happy, Healthy, Prosperous New Year to ALL ![]() |
|
||||
|
MathRound
Quote:
|
![]() |
| Bookmarks |
| Tags |
| histogram, forex, ZUP_v1.mq4 |
| 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 10:53 PM | |
| Forex SRDC Sidus Sibkis EA MT4 Forum OTCSmart | This thread | Refback | 12-08-2007 12:46 PM | |