• Home
  • Forums
  • Trades
  • News
  • Calendar
  • Market
  • Brokers
  • Login
  • Join
  • User/Email: Password:
  • 3:58pm
Menu
  • Forums
  • Trades
  • News
  • Calendar
  • Market
  • Brokers
  • Login
  • Join
  • 3:58pm
Sister Sites
  • Metals Mine
  • Energy EXCH
  • Crypto Craft

Options

Bookmark Thread

First Page First Unread Last Page Last Post

Print Thread

Similar Threads

I will code your scalping EAs for no charge 36 replies

I will code your pivot EAs for no charge 18 replies

EAs and indicators relating to moutaki... 22 replies

InterbankFX has loaded its MT4 platform with custom EAs, indicators and scripts 1 reply

Need help to code EAs for MT4 and MT5 2 replies

  • Platform Tech
  • /
  • Reply to Thread
  • Subscribe
  • 36,295
Attachments: I will code your EAs and Indicators for no charge
Exit Attachments

I will code your EAs and Indicators for no charge

  • Last Post
  •  
  • 1 263726382639Page 26402641 2642
  • 1 Page 2640 2642
  •  
  • Post #52,781
  • Quote
  • Jun 22, 2022 6:52pm Jun 22, 2022 6:52pm
  •  Magregus
  • | Joined May 2015 | Status: Member | 118 Posts
Hello,

Need an expert advisor that places a pending order based on the previous candle high/low. Once the trade is triggered the other pending order is deleted.

EA also needs to open an order for all pairs/selected pairs. A basket TP/SL for all the pairs. Also a a trading timeframe that can be specified, so you can set to start trading at 9UTC or 11UTC, or both.

cheers
 
 
  • Post #52,782
  • Quote
  • Edited at 9:12pm Jun 22, 2022 8:54pm | Edited at 9:12pm
  •  khat17
  • | Joined Feb 2018 | Status: Member | 60 Posts
Quoting jeanlouie
Disliked
{quote} Yes post the code that you currently have
Ignored
Here's the info. As I said - not familiar with MQL and haven't done any programming for a looong time. I tried based on information found online and using the help file. Will integrate the information you posted as well and see. I also need to move it from being an EA to an indicator...

Inserted Code
 //+------------------------------------------------------------------+
//|                                                  8HRectangle.mq4 |
//|                        Copyright 2022, MetaQuotes Software Corp. |
//|                                             https://www.mql5.com |
//+------------------------------------------------------------------+
#property copyright "Copyright 2022, MetaQuotes Software Corp."
#property link      "https://www.mql5.com"
#property version   "1.1"
#property strict
void OnTick()
  {
//Define EndOfOpeningPeriod
string EndOfOpeningPeriod="16:00:";
// Calculate the current time
string CurrentTime = TimeToStr(TimeLocal(), TIME_SECONDS);
// if defined time period is found, deliver -1
int EndOfOpeningPeriodFound = StringFind(CurrentTime, EndOfOpeningPeriod, 0);
// Find the highest of the last 30 candles
int HighestCandle = iHighest(_Symbol, PERIOD_H4, MODE_HIGH, 30, 0);
// Find the lowest of the last 30 candles
int LowestCandle = iLowest(_Symbol, PERIOD_H4, MODE_LOW, 30, 0);
// Output the time on the chart
Comment("Current Time: ", CurrentTime);
// If desired value is found in current time
 if(EndOfOpeningPeriodFound != -1)
// Delete the rectangle if it already exists
ObjectDelete("Rectangle");
//Create an object, as rectangle, on the chart. Lowst and highest prices from candle 0 to candle 30.
ObjectCreate("Rectangle", OBJ_RECTANGLE, 0, Time[0], High[HighestCandle], Time[30], Low[LowestCandle]);
  
  }
//+------------------------------------------------------------------+

*EDIT*
So I'm getting this.

Attached Image (click to enlarge)
Click to Enlarge

Name: screenshot.png
Size: 2 KB

Which I assume is related to this. Prompted for it as well.

Inserted Code
//chart history has been updated or loaded, setting prev_calc to 0, make the rect
   if(prev_calculated==0){
      ObjectCreate(0,name,OBJ_RECTANGLE,0,t1,p1,t2,p2);

From what I've seen though - MQL isn't that difficult to understand - but would still need to learn the language.

Inserted Code
//start time is the start of the week, or the time of the current week tf candle
   long t1 = iTime(_Symbol,PERIOD_W1,0);

Was unaware that you could define the W1 as the start period. Thought since I was working with the H4 candles that I'd have to use that.

Inserted Code
//end time is 1 week from the start (10080minutes in a week * 60seconds, time is in seconds, chart tfs are in minutes, 1/5/15/30/60/240/1440/10080/43200)
   long t2 = t1+60*60*24*7;//or+10080*60

And this requires math - lol. Not TOO difficult - but still requires working out.

Inserted Code
//the candle index on the current tf of where t1 is, candle indexing is timeseries, 0 is the rightmost recent candle
   //false is used because the exact time of the w1 candle may not exist on other tfs
   int ileft_candle = iBarShift(_Symbol,_Period,t1,false);

Understood as the high and low of each candle differs. The timeframes are different.

Inserted Code
   //get the highest high from the week start, t1, to the live bar
   double p1 = iHigh(_Symbol,_Period,iHighest(_Symbol,_Period,MODE_HIGH,ileft_candle,0));
   //the lower rect price
   double p2 = iLow(_Symbol,_Period,iLowest(_Symbol,_Period,MODE_LOW,ileft_candle,0));

Here it's reading the high and low - but I'm not seeing where p1 and p2 were defined. I guess it's being defined here using double - floating point numbers - this part I don't really get.

The stuff you posted is done nicely and has comments for each section. Good stuff. But it's still quite foreign to me though. Not as simple as I thought it would be.

I plan to just remove it from the chart after it's run each week. Just need it to map out the zone. If you or others decide to team up and improve on it - I for one would be most grateful. But basic is good - it's a great start.

So many thanks to you and others that have sent me DMs or made other suggestions.

Quoting Treptrader
Disliked
{quote} i like this idea. can u post a screenshot?
Ignored
Trying to refine it now with the info I got from @jeanlouie - but I can post the one I did before.

Attached Image (click to enlarge)
Click to Enlarge

Name: screenshot.png
Size: 28 KB

That's what it does after taking the high and low - but it's not done correctly. It should look like below. I'm also not sure how to get the color changed...

Attached Image (click to enlarge)
Click to Enlarge

Name: screenshot.png
Size: 28 KB


The issue is that my original one just counts the last 30 candles and draws the high and low based off that. What @jeanlouie has done should do a better job - but needs a little debugging.
 
 
  • Post #52,783
  • Quote
  • Jun 22, 2022 8:56pm Jun 22, 2022 8:56pm
  •  newhope
  • | Joined Mar 2018 | Status: Member | 90 Posts
Quoting tintep
Disliked
{quote} Hi lucky1359. Your indicator it decompiled. but I like formular for calculate. I adapt formular for calculate in to this indicator. I test with "Buyers Sellers Volume Dashboard " from CJA. I think it good to find reverse. You can try this . it not auto hide but I made on off button. {image} {file}
Ignored
Nice Buyers/Sellers Dashboard tintep,
is it possible to share the snippet of codes for Simple On/Off Button ? i mean, the part that we can add to our existing codes, without changing much of it... Replacing some of my code is ok, but not too much .. (Ratio of changing / stay using my old code is not so much). Can some one give me clue on it ? Currently i find this : https://www.forexfactory.com/thread/...-onoff-buttons , but still need to learn it one by one, so many examples and do not know which one is better for my needs... To save times, so i ask it here ...Hope that i can get the solution faster .... thanks before for all you helps ...
 
 
  • Post #52,784
  • Quote
  • Jun 22, 2022 9:36pm Jun 22, 2022 9:36pm
  •  eess
  • Joined Feb 2021 | Status: Member | 450 Posts
Quoting newhope
Disliked
{quote} Nice Buyers/Sellers Dashboard tintep, is it possible to share the snippet of codes for Simple On/Off Button ? i mean, the part that we can add to our existing codes, without changing much of it... Replacing some of my code is ok, but not too much .. (Ratio of changing / stay using my old code is not so much). Can some one give me clue on it ? Currently i find this : https://www.forexfactory.com/thread/...-onoff-buttons , but still need to learn it one by one, so many examples and do not know which one...
Ignored

There isn't a standard/copy and paste way to do the ON/OFF thing unfortunately....especially for non-programmers....It is actually easier to code a Moving Average or Bollinger Bands etc than to do the ON/OFF thing, contrary to what many non-programmers think, so don't really have a shortcut way of learning this thing...
 
1
  • Post #52,785
  • Quote
  • Jun 23, 2022 1:20am Jun 23, 2022 1:20am
  •  Mahapathy
  • | Joined Jun 2012 | Status: Member | 41 Posts
Quoting Mahapathy
Disliked
Hi Coders, Could any one pls modify the attached indicator that could show 6 Moving averages, presently it is showing 3 only And also pls add a input that the window can be placed in any Conner of the chart Your help will be more useful for me Thanking you in advance {file}
Ignored
Any one pls Help
Tamizhan
 
 
  • Post #52,786
  • Quote
  • Jun 23, 2022 5:10am Jun 23, 2022 5:10am
  •  yoko
  • | Joined Jan 2016 | Status: Member | 83 Posts
Hi coders, Could you please code a 2 EMA cross indicator I use a 50-200 EMA which shows an arrow on the chart when 2 EMA cross over and name Short or LONG on the top right corner in chart?

Thank you very much in advance.
 
 
  • Post #52,787
  • Quote
  • Jun 23, 2022 9:07am Jun 23, 2022 9:07am
  •  eess
  • Joined Feb 2021 | Status: Member | 450 Posts
Quoting yoko
Disliked
Hi coders, Could you please code a 2 EMA cross indicator I use a 50-200 EMA which shows an arrow on the chart when 2 EMA cross over and name Short or LONG on the top right corner in chart? Thank you very much in advance.
Ignored
Modified one of the existing codes to add in the text.

Parameters relating to the text:
Attached Image (click to enlarge)
Click to Enlarge

Name: screenshot.png
Size: 6 KB
Attached Image (click to enlarge)
Click to Enlarge

Name: screenshot.png
Size: 11 KB
Attached File
File Type: mq4 2xMA (candles + arrows+Text) BT 1.3.mq4   37 KB | 73 downloads
 
1
  • Post #52,788
  • Quote
  • Edited at 10:01am Jun 23, 2022 9:47am | Edited at 10:01am
  •  jega2007
  • | Joined Mar 2016 | Status: Member | 104 Posts
Hi coders, Could you please add alert in this indicator
This indicator have a alert ...but i want alert in 5M and filter by 1 hour

Example ..

if JPY cross above 52 in 5 Minutes chart (Candle Close) and at the same time JPY is already above 55 in 1 Hour then send alert (BUY ALL JPY)

if JPY cross below 48 in 5 Minutes chart (Candle Close) and at the same time JPY is already below 45 in 1 Hour then send alert (SELL ALL JPY)

send alert for 8 currency


please add push notification and email alert

Sorry for my broken English
Thank you
Attached Image (click to enlarge)
Click to Enlarge

Name: Screenshot 2022-06-23 190228.jpg
Size: 223 KB
Attached File
File Type: mq4 RSICurrencyStrength_v1.0 600+.mq4   63 KB | 37 downloads
 
 
  • Post #52,789
  • Quote
  • Jun 23, 2022 1:04pm Jun 23, 2022 1:04pm
  •  Mahapathy
  • | Joined Jun 2012 | Status: Member | 41 Posts
Quoting Mahapathy
Disliked
Hi Coders, Could any one pls modify the attached indicator that could show 6 Moving averages, presently it is showing 3 only And also pls add a input that the window can be placed in any Conner of the chart Your help will be more useful for me Thanking you in advance {file}
Ignored
Could Some one pls help
Tamizhan
 
 
  • Post #52,790
  • Quote
  • Jun 23, 2022 1:38pm Jun 23, 2022 1:38pm
  •  Nonip
  • | Joined Nov 2019 | Status: Member | 130 Posts
Quoting BlueRain
Disliked
{quote} I thought you have attached EA to this thread. I have removed that line for you. Also, I did set MagicNumber=0 as default. {file} {file}
Ignored
Hi BlueRain,

I have sent you a PM.

kind regards,
Nonip.
"You can't buy the bottom, nor sell the top. The best you can strive for is
 
 
  • Post #52,791
  • Quote
  • Edited at 2:50pm Jun 23, 2022 1:42pm | Edited at 2:50pm
  •  jeanlouie
  • Joined Dec 2010 | Status: Member | 1,240 Posts | Online Now
Quoting khat17
Disliked
{quote}...
Ignored
Quote
Disliked
So I'm getting this.
Correct, because OnCalculate is not the same as an OnTick, one is for indicators and the latter for ea's. OnCalc has some useful parameters provded and one of them is prev_calculated. While they're not necessary theyre useful.

Quote
Disliked
Was unaware that you could define the W1 as the start period. Thought since I was working with the H4 candles that I'd have to use that.
You mentioned you want the rect to cover the whole week, so regardless of tf (as long as its below w1), the current week candle time would be the start of the week, in the same way that the time of an hour candle is the start time of that hour, so too is the week's time the start time of the week. There are other ways to get the start of a new week but that's the simplest,

Quote
Disliked
And this requires math - lol. Not TOO difficult - but still requires working out.
Regarding the ileft_candle, it's just getting the candle position of the week start time, to use in getting the highest/lowest in that time, on the tf youre on. ie pic
Attached Image (click to enlarge)
Click to Enlarge

Name: screenshot.png
Size: 8 KB

Quote
Disliked
but it's not done correctly. It should look like below. I'm also not sure how to get the color changed...
Even if the w1 tf isn't updated yet, the starting time wouldn't lie inside a week, it would be a previous week, then when the w1 tf has been updated, by the time the next tick arrives usually, then the start time would update to the current week start.

If the current tf doesn't have the time of the week start (start of week is 00:00 but first candle is at 22:00), then the time will be 1 candle off, ie objects are placed on the next left candle before the time of the object. It adds another thing to consider, but for completeness:

Inserted Code
   //look for the exact time match of the week start on the current tf
   int ileft_candle= iBarShift(_Symbol,_Period,t1,true);
   //if the return is -1, error, then lookagain but not for an exact match
   // and subtract 1 to get the next rightside candle, to use as t1
   if(ileft_candle==-1){
      ileft_candle= iBarShift(_Symbol,_Period,t1,false)-1;
      t1 = Time[ileft_candle];
   }
   //then add 1 week worth of seconds to set t2 to
 
   //printout in the terminal experts tab the index used, n measure manually n compare
   Print("i_bsw=",i_bsw);

Resulting gif
Attached Image (click to enlarge)
Click to Enlarge

Name: miscgif1.gif
Size: 269 KB

and press f1 after highlighting ObjectSetInteger() in your editor to bring up the doc on things that it can set, color is included.
 
 
  • Post #52,792
  • Quote
  • Jun 23, 2022 2:55pm Jun 23, 2022 2:55pm
  •  xmatax
  • | Joined Feb 2020 | Status: Member | 7 Posts
You can add a push alert and also popup alert. Thank you very much
Attached File
File Type: ex4 MACD_ColorHist_Alert.ex4   24 KB | 18 downloads
Attached File
File Type: mq4 MACD_ColorHist_Alert.mq4   11 KB | 26 downloads
 
 
  • Post #52,793
  • Quote
  • Jun 23, 2022 3:28pm Jun 23, 2022 3:28pm
  •  khat17
  • | Joined Feb 2018 | Status: Member | 60 Posts
Quoting jeanlouie
Disliked
Resulting gif {image} and press f1 after highlighting ObjectSetInteger() in your editor to bring up the doc on things that it can set, color is included.
Ignored
I'm probably doing something wrong here...

Inserted Code
//+------------------------------------------------------------------+
//| 8HRectangle.mq4 |
//| Copyright 2022, MetaQuotes Software Corp. |
//| [url]https://www.mql5.com[/url] |
//+------------------------------------------------------------------+
#property copyright "Copyright 2022, MetaQuotes Software Corp."
#property link "https://www.mql5.com"
#property version "1.3"
#property strict
void OnTick()
{
string name = "random rect";
//start time is the start of the week, or the time of the current week tf candle
long t1 = iTime(_Symbol,PERIOD_W1,0);
//end time is 1 week from the start (10080minutes in a week * 60seconds, time is in seconds, chart tfs are in minutes, 1/5/15/30/60/240/1440/10080/43200)
long t2 = t1+60*60*24*7;//or+10080*60
//the candle index on the current tf of where t1 is, candle indexing is timeseries, 0 is the rightmost recent candle
//false is used because the exact time of the w1 candle may not exist on other tfs
int ileft_candle = iBarShift(_Symbol,_Period,t1,false);
//get the highest high from the week start, t1, to the live bar
double p1 = iHigh(_Symbol,_Period,iHighest(_Symbol,_Period,MODE_HIGH,ileft_candle,0));
//the lower rect price
double p2 = iLow(_Symbol,_Period,iLowest(_Symbol,_Period,MODE_LOW,ileft_candle,0));
 
//look for the exact time match of the week start on the current tf
//int ileft_candle= iBarShift(_Symbol,_Period,t1,true);
//if the return is -1, error, then lookagain but not for an exact match
// and subtract 1 to get the next rightside candle, to use as t1
if(ileft_candle==-1){
ileft_candle= iBarShift(_Symbol,_Period,t1,false)-1;
t1 = Time[ileft_candle];
}
//then add 1 week worth of seconds to set t2 to
 
//printout in the terminal experts tab the index used, n measure manually n compare
Print("i_bsw=",i_bsw);
 
//chart history has been updated or loaded, setting prev_calc to 0, make the rect
if(prev_calculated==0){
ObjectCreate(0,name,OBJ_RECTANGLE,0,t1,p1,t2,p2);
}
 
//update rect coords
ObjectSetInteger(0,name,OBJPROP_TIME1,t1);//point 1, update to the current week start on the h4 tf
ObjectSetDouble(0,name,OBJPROP_PRICE1,p1);//point 1, update upper price in case new high is made
ObjectSetInteger(0,name,OBJPROP_TIME2,t2);//point 2, update to the current week start on the h4 tf + 1 week
ObjectSetDouble(0,name,OBJPROP_PRICE2,p2);//point 2, update lower price in case new low is made
 
 
 
}
 
//+------------------------------------------------------------------+

Now I've got 2 errors.

Attached Image (click to enlarge)
Click to Enlarge

Name: screenshot.png
Size: 3 KB

I do get some of the explanations, but I'm not sure why I'm getting these now. I guess I need to define the variables/identifiers, but not sure where. Could I ask you to attach your MQL file from the example you gave? I'd copy/paste and also do a comparison to get an idea of what was done wrong. Again - not familiar with MQL but the language does seem pretty straightforward. Just using my prior (limited) recollection of Pascal and the general programming flow to figure things out.

And thanks again for your efforts.
 
 
  • Post #52,794
  • Quote
  • Edited Jun 24, 2022 2:59am Jun 23, 2022 4:38pm | Edited Jun 24, 2022 2:59am
  •  Isabella_D
  • Joined Jan 2012 | Status: Member | 853 Posts
Quoting eess
Disliked
{quote} Einen der vorhandenen Codes geändert, um ihn in den Text einzufügen. Parameter zum Text: {image} {file} {image}
Ignored
thx ess,
could you kindly add alert and add phone alert? it does not work now.
Thank you

edit: sorry, my mobile did not worked well
 
 
  • Post #52,795
  • Quote
  • Jun 23, 2022 4:55pm Jun 23, 2022 4:55pm
  •  jeanlouie
  • Joined Dec 2010 | Status: Member | 1,240 Posts | Online Now
Quoting khat17
Disliked
{quote} ...Now I've got 2 errors...
Ignored
You can address them, you just blindly copy n pasted it in. i_bsw was some random variable for barshift of the w time, its what the ileftcandle is. Prev_calc is something that belongs in OnCalc in indicators.

The point is:
- make the rect
- get the start time t1, and the end time t2
- get the upper price p1 and the lower price p2
- give the rect it those time price coords

Play around by setting a vertical line object to see how to properly deal with time, and a horizontal line object to see how to deal with price.
 
1
  • Post #52,796
  • Quote
  • Jun 23, 2022 11:34pm Jun 23, 2022 11:34pm
  •  eess
  • Joined Feb 2021 | Status: Member | 450 Posts
Quoting Isabella_D
Disliked
{quote} thx ess, could you kindly add alert and add phone alert? it does not work now. Thank you
Ignored

You need to set the input parameters for the alerts.
 
1
  • Post #52,797
  • Quote
  • Jun 24, 2022 1:34am Jun 24, 2022 1:34am
  •  sargh
  • | New Member | Status: Junior Member | 1 Post
Hi guys,

I am actually looking for some help. As I am new I cannot create a post, however I am doing my first code (never code b4 in my life).
I am creating a button buy/sell to have stoploss/takeprofit based on atr value.

would really appreciate if someone could look at it and give me some feedback why is it not working. At the moment it is getting the same stop loss value as the entry. I have not started working on the TP part of it since I cannot get the SL to work

thanks in advance for any help

Inserted Code
 
input double Fixed_Lot_Size = 0.01;   //--- lot size for opening trade
input int Stop_Loss_Points = 100;     //--- stop loss if atr not used
input bool Use_ATR = false;
input int ATR_Period = 14;
input double ATR_MultiplierSL = 1.00; //--- stop loss atr multiplier
input double ATR_MultiplierTP = 1.50; //--- take profit atr multiplier
 

//+------------------------------------------------------------------+
//| Expert initialization function                                   |
//+------------------------------------------------------------------+
int OnInit()
{
   ButtonCreate();
   return(INIT_SUCCEEDED);
}
//+------------------------------------------------------------------+
//| Expert deinitialization function                                 |
//+------------------------------------------------------------------+
void OnDeinit(const int reason)
{
   ObjectDelete("BuyButton");
   ObjectDelete("SellButton");
}
//+------------------------------------------------------------------+
//| Expert tick function                                             |
//+------------------------------------------------------------------+
void OnTick()
{
//---
}
//+------------------------------------------------------------------+
//| ChartEvent function                                              |
//+------------------------------------------------------------------+
void OnChartEvent(const int id,
                  const long &lparam,
                  const double &dparam,
                  const string &sparam)
{
   if(id == CHARTEVENT_OBJECT_CLICK && sparam == "BuyButton")
      PlaceOrder(OP_BUY);
   if(id == CHARTEVENT_OBJECT_CLICK && sparam == "SellButton")
      PlaceOrder(OP_SELL);
}
//+------------------------------------------------------------------+

//+------------------------------------------------------------------+
//|                                                                  |
//+------------------------------------------------------------------+
void ButtonCreate()
{

   int chart_ID = 0;                                          //--- choice of window for button
   string name = "BuyButton";
   ObjectCreate(0,name,OBJ_BUTTON,0,0,0);
   if(!ObjectCreate(chart_ID,name,OBJ_BUTTON,0,0,0))
   ObjectSetInteger(chart_ID,name,OBJPROP_XDISTANCE,50);      //--- set button coordinates
   ObjectSetInteger(chart_ID,name,OBJPROP_YDISTANCE,50);      //--- set button coordinates
   ObjectSetInteger(chart_ID,name,OBJPROP_XSIZE,60);          //--- set button size
   ObjectSetInteger(chart_ID,name,OBJPROP_YSIZE,30);          //--- set button size
   ObjectSetInteger(chart_ID,name,OBJPROP_CORNER,0);          //--- set the chart's corner, relative to which point coordinates are defined
   ObjectSetString(chart_ID,name,OBJPROP_TEXT,"BUY");         //--- set the text
   ObjectSetString(chart_ID,name,OBJPROP_FONT,"Arial");       //--- set text font
   ObjectSetInteger(chart_ID,name,OBJPROP_FONTSIZE,12);       //--- set font size
   ObjectSetInteger(chart_ID,name,OBJPROP_COLOR,clrBlack);    //--- set text color
   ObjectSetInteger(chart_ID,name,OBJPROP_BGCOLOR,clrBlue);   //--- set background color
   ObjectSetInteger(chart_ID,name,OBJPROP_ZORDER,0);          //--- set border color

   string name2 = "SellButton";
   ObjectCreate(0,name2,OBJ_BUTTON,0,0,0);
   if(!ObjectCreate(chart_ID,name2,OBJ_BUTTON,0,0,0))
   ObjectSetInteger(chart_ID,name2,OBJPROP_XDISTANCE,50);     //--- set button coordinates
   ObjectSetInteger(chart_ID,name2,OBJPROP_YDISTANCE,81);     //--- set button coordinates
   ObjectSetInteger(chart_ID,name2,OBJPROP_XSIZE,60);         //--- set button size
   ObjectSetInteger(chart_ID,name2,OBJPROP_YSIZE,30);         //--- set the chart's corner, relative to which point coordinates are defined
   ObjectSetInteger(chart_ID,name2,OBJPROP_CORNER,0);         //--- set the text
   ObjectSetString(chart_ID,name2,OBJPROP_TEXT,"SELL");       //--- set text font
   ObjectSetString(chart_ID,name2,OBJPROP_FONT,"Arial");      //--- set font size
   ObjectSetInteger(chart_ID,name2,OBJPROP_FONTSIZE,12);      //--- set font size
   ObjectSetInteger(chart_ID,name2,OBJPROP_COLOR,clrBlack);   //--- set text color
   ObjectSetInteger(chart_ID,name2,OBJPROP_BGCOLOR,clrRed);   //--- set background color
   ObjectSetInteger(chart_ID,name2,OBJPROP_ZORDER,0);         //--- set border color
}
//+------------------------------------------------------------------+
//|                                                                  |
//+------------------------------------------------------------------+
void PlaceOrder(int dir)
{
   if(dir==OP_BUY)
     {
      int stopLoss = GetStopLoss();
      int ticket = OrderSend(Symbol(),dir,Fixed_Lot_Size,Ask,30,0,0,NULL,0,0,0);
      OrderModify(ticket,OrderOpenPrice(),Ask-0,Ask+0,0,clrGreen);
     }
   else
      if(dir==OP_SELL)
        {
         int stopLoss = GetStopLoss();
         int ticket = OrderSend(Symbol(),dir,Fixed_Lot_Size,Bid,30,0,0,NULL,0,0,0);
         OrderModify(ticket,OrderOpenPrice(),Bid-0,Bid+0,0,clrRed);
        }
}
//+------------------------------------------------------------------+
//|                                                                  |
//+------------------------------------------------------------------+
int GetStopLoss()
{
   int stopLoss = Stop_Loss_Points;
 
   if(Use_ATR == true)
     {
      double atr = iATR(_Symbol, _Period, ATR_Period, 1);
      stopLoss = (atr*ATR_MultiplierSL/_Point);
          
     }
   return stopLoss;
}
//+------------------------------------------------------------------+
 
 
  • Post #52,798
  • Quote
  • Jun 24, 2022 3:28am Jun 24, 2022 3:28am
  •  yoko
  • | Joined Jan 2016 | Status: Member | 83 Posts
Quoting eess
Disliked
{quote} Modified one of the existing codes to add in the text. Parameters relating to the text: {image} {file} {image}
Ignored
Hi eess,

thank you very much. Would you please add indi not modified? Just indi which shows a point on the chart when 2 EMA cross over and text Short or LONG on the top right corner in chart without coloured candles? When I changed colour of the candles, text disappeared.

Thanks a lot.
 
 
  • Post #52,799
  • Quote
  • Jun 24, 2022 4:17am Jun 24, 2022 4:17am
  •  Maijin
  • | Joined Dec 2013 | Status: Member | 79 Posts
Quoting xmatax
Disliked
You can add a push alert and also popup alert. Thank you very much{file}{file}
Ignored
Attached File
File Type: ex4 MACD_ColorHist_Alert.ex4   22 KB | 24 downloads
 
 
  • Post #52,800
  • Quote
  • Jun 24, 2022 5:27am Jun 24, 2022 5:27am
  •  Slingshots1
  • Joined Feb 2012 | Status: Member | 976 Posts
Quoting jeanlouie
Disliked
{quote} You can address them, you just blindly copy n pasted it in. i_bsw was some random variable for barshift of the w time, its what the ileftcandle is. Prev_calc is something that belongs in OnCalc in indicators. The point is: - make the rect - get the start time t1, and the end time t2 - get the upper price p1 and the lower price p2 - give the rect it those time price coords Play around by setting a vertical line object to see how to properly deal with time, and a horizontal line object to see how to deal with price.
Ignored
Kindly assist i need a single arrow alert pointer for the attached breakout box the strat is based on 4hrs , box drawn based on the first high and low of the beginning of each week, with 20 buffer up or down, 4hrcandle that breaks and closed above or below is the signal candle, i need arrow signal that should confirm the break,i know youve done stuff like that in one of your postings here, please see the attached screenshot,normally the breakout make take a day or two or more before the break comes , but once it does it makes profit with
Attached File
File Type: mq4 1 Box 4.mq4   7 KB | 74 downloads
Attached Image (click to enlarge)
Click to Enlarge

Name: FF.PNG
Size: 19 KB
at least 3candles
 
 
  • Platform Tech
  • /
  • I will code your EAs and Indicators for no charge
  • Reply to Thread
    • 1 263726382639Page 26402641 2642
    • 1 Page 2640 2642
8 traders viewing now, 5 are members:
Uru
,
Olababa
,
mrbojangles1
,
ellite
,
abdohafez
  • More
Top of Page
  • Facebook
  • Twitter
About FF
  • Mission
  • Products
  • User Guide
  • Media Kit
  • Blog
  • Contact
FF Products
  • Forums
  • Trades
  • Calendar
  • News
  • Market
  • Brokers
  • Trade Explorer
FF Website
  • Homepage
  • Search
  • Members
  • Report a Bug
Follow FF
  • Facebook
  • Twitter

FF Sister Sites:

  • Metals Mine
  • Energy EXCH
  • Crypto Craft

Forex Factory® is a brand of Fair Economy, Inc.

Terms of Service / ©2022