i started a thread here about updating an indi and an ea if anyone could please help. thank you
- #6,207
- Oct 26, 2014 7:26pm Oct 26, 2014 7:26pm
- Joined Oct 2012 | Status: private | 2,606 Posts
just do it
I will code your pivot EAs for no charge 28 replies
I will code your scalping EAs for no charge 163 replies
Oanda MT4 - Indicators and EAs not showing 2 replies
EAs and indicators relating to moutaki... 22 replies
InterbankFX has loaded its MT4 platform with custom EAs, indicators and scripts 1 reply
DislikedHello, can you help me add a sound/message alert to these arrow indicator ? {file}Ignored
DislikedHi, Can you make an alert for this indicator? My imagine is it would be the best, if make an alert when on M1, M5, M15, timeframes the all indicator's arrow is same direction. Or another idea, and i think is better, a changeable option, that I can set what timeframes on see the all arrow matching, and there will be a roll down menu where can change M1, M5, M15, M30, H1. I mean If I set the M30, then it not showing only the M30, but M1, M5, M15, and M30, all together. I don't know what is the envelopes 14 (the last), but this is often not shows arrows...Ignored
//+------------------------------------------------------------------+
//| Open2Orders_price reached.mq4 |
//| Danjuma |
//| |
//+------------------------------------------------------------------+
#property copyright "Danjuma"
#property link ""
#property version "1.00"
#property strict
//--- extern parameters
extern bool UseActualSlTp=false;
extern double StopLossPrice=0.0;
extern double TakeProfitPrice=0.0;
extern string Note="0 in Entry field means Market Order Buy";
extern double Entry=0.0;
extern bool MicroOrdersAllowed=true;
extern bool MiniOrdersAllowed=true;
extern bool UseMoneyMgmt=false;
extern double RiskPercent=1.0;
extern double Lots=0.01;
extern double StopLoss=0.0;
extern double TakeProfit=0.0;
extern double TriggerPrice=0.0;
extern string Comments="Buy Script";
//+------------------------------------------------------------------+
//| Expert initialization function |
//+------------------------------------------------------------------+
int OnInit()
{
//---
//---
return(INIT_SUCCEEDED);
}
//+------------------------------------------------------------------+
//| Expert deinitialization function |
//+------------------------------------------------------------------+
void OnDeinit(const int reason)
{
//---
}
//+------------------------------------------------------------------+
//| Expert tick function |
//+------------------------------------------------------------------+
void OnTick()
{
double Risk = RiskPercent / 100;
int OrdersizeAllowed = 0;
int Mode = OP_BUYSTOP;
if (Ask > Entry && Entry > 0) Mode = OP_BUYLIMIT;
if (Entry == 0) {Entry = Ask; Mode = OP_BUY;}
double SLB = Entry - StopLoss*Point, TPB = Entry + TakeProfit*Point;
if (UseActualSlTp)
{
StopLoss = (Entry-StopLossPrice)/Point;
SLB = StopLossPrice;
TPB = TakeProfitPrice;
}
if (MiniOrdersAllowed) OrdersizeAllowed=1;
if (MicroOrdersAllowed) OrdersizeAllowed=2;
if (UseMoneyMgmt)
Lots = NormalizeDouble( AccountBalance()*Risk/StopLoss/(MarketInfo(Symbol(), MODE_TICKVALUE)),OrdersizeAllowed);
if ((Lots < 0.01&&MicroOrdersAllowed) || (Lots < 0.1&&MiniOrdersAllowed&&MicroOrdersAllowed==false))
{
Comment("YOUR LOTS SIZE IS TOO SMALL TO PLACE!");
}
if(Lots > 0 && Bid < TriggerPrice)
{
OrderSend(Symbol(),Mode, Lots, Entry, 2,SLB , TPB, Comments, 0, NULL, LimeGreen);
OrderSend(Symbol(),Mode, Lots, Entry, 2,SLB , 0, Comments, 0, NULL, LimeGreen);
}
return;
}
//+------------------------------------------------------------------+
//| ChartEvent function |
//+------------------------------------------------------------------+
void OnChartEvent(const int id,
const long &lparam,
const double &dparam,
const string &sparam)
{
//----
}
//+------------------------------------------------------------------+ DislikedWould be grateful if anyone could help with this. I am not much of a coder and just knocking up EAs etc by copying snippets of codes here and there (decided probably the best way is to start learning how to code these things myself as one is not lucky to get much assistant from others in coding something from scratch these days). Below is a code for an EA I have written (well copied most of the codes from others) to place two pending orders at user specified entry price, when a particular price is reached). The orders are being placed, but the issue...Ignored
DislikedAnother option is to set a flag as false initially and then reset that same flag once the orders are placed, then check the flag status each time you look for a new trade. eg, bool OrderPlaced = false; //make sure this statement is outside your decision loop and only gets reset after all trades are closed ... ... ... if(Lots > 0 && Bid < TriggerPrice && !OrderPlaced ) { OrderSend(Symbol(),Mode, Lots, Entry, 2,SLB , TPB, Comments, 0, NULL, LimeGreen); OrderSend(Symbol(),Mode, Lots, Entry, 2,SLB , 0, Comments, 0, NULL, LimeGreen); OrderPlaced = TRUE;...Ignored
Disliked{quote} Hello RedLineFred, the bit of statement: "...and only gets reset after all trades are closed...", could you please explian what you mean? The pending orders once triggered can remain opened for days/weeks, and in the mean time I might want to set more pending orders for the same pair and even at the same trigger price and entry price. So not too sure what you mean by the flag getting reset only when all trades are closed. Many thanksIgnored
DislikedHi, I have an MQ4 file that I got a programmer to design for me a few years ago. I decided to dust off the idea and give it another whirl, however my programmer has disappeared and the MQ4 file doesnt seem to work anymore. I'm presuming thats due to an update in the Metatrader platform. Anyone who might be able to help me re-program the idea or unlock the file? Much appreciated :-) Cheers, CraigIgnored
Disliked{quote} You will need to consider how you use this flag and when to reset it. While "OrderPlaced = TRUE;" the code will not place another trade. At some point this will need to be set to false, at which time the EA will again place orders. My suggestion was to reset after all trades are closed out, but you can do so at any time and additional orders will then be placed.Ignored