
You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register
No indicators I am using maths formular as below.
double high = iHigh(NULL,1440,1);
double low = iLow(NULL,1440,1);
double close = iClose(NULL,1440,1);
double P = (high+low+close)/3;
Cheers
Beno
interesting
+ tp/sl may be considering average (bar) range per session?
This is getting better and better Beno. Reports are always positives.
You're proving the power of pivots.
I have been thinking about how to create a compounding formular based on the size of the previous bar (pivot bar) and have come up with this.
p-open/p*100 the differacne between the pivot and the open.
So the theory is the creater the distance between the pivot and the open of the current bar the high he chance of the next bar heading in the same direction so the greater you should risk.
It's just a crazy idea please let me know if it has any legs.
There is a problem with this EA when running multiple pairs you will end up with "trade context busy" due to the fact this works on the open of a new bar
I have been trying to implement the following code to try and rid the problem
the article is here Error 146 ("Trade context busy") and How to Deal with It - MQL4 Articles
but I keep getting an error because of the ... could someone please point me in the right direction as i have searched in the usual places but have not found anything.
#include
int start()
{
// check whether the market should be entered now
...
// calculate the StopLoss and TakeProfit levels, and the lot size
...
// wait until the trade context is free and then occupy it (if an error occurs,
// leave it)
if(TradeIsBusy() < 0)
return(-1);
// refresh the market info
RefreshRates();
// recalculate the levels of StopLoss and TakeProfit
...
// open a position
if(OrderSend(...) < 0)
{
Alert("Error opening position # ", GetLastError());
}
// set the trade context free
TradeIsNotBusy();
return(0);
}
Cheers
Beno
You defined which scalp is for Forex Beno. This system and EA have future.
Can you help me duplicate your backtesting results? What pair and TF are you using? How about the SL and TP? When I back test this using FXDD, I cannot find a winning combination. Is it the broker?
Thanks,
Dave
Can you help me duplicate your backtesting results? What pair and TF are you using? How about the SL and TP? When I back test this using FXDD, I cannot find a winning combination. Is it the broker?
Thanks,
DaveHi,
AlpariUS-Demo (Build 218)
Symbol EURUSD (Euro vs US Dollar)
Period 4 Hours (H4) 2001.04.25 16:00 - 2008.09.26 20:00
ModelControl points (a very crude method, the results must not be considered)
Can you help me duplicate your backtesting results? What pair and TF are you using? How about the SL and TP? When I back test this using FXDD, I cannot find a winning combination. Is it the broker?
Thanks,
Davei just use what is in the pea2 ea sl=300 tp=100 ts=12 and thats about it I use daily tf.
This is what I have done so far am I on the right track ??? I still have the '.' which refers to the dot in if(OrderSend(...) < 0) do I have to fill in the Symbol(), OP_SELL, Lots, Bid, Slippage, StopLossLevel, TakeProfitLevel, "Sell(#" + MagicNumber + ")", MagicNumber, 0, DeepPink); or what sorry if this looks confusing but I'm rubbish at this stuff
//Sell
if (Order == SIGNAL_SELL && ((EachTickMode && !TickCheck) || (!EachTickMode && (Bars != BarCount)))) {
if(!IsTrade) {
//Check free margin
if (AccountFreeMargin() < (1000 * Lots)) {
Print("We have no money. Free Margin = ", AccountFreeMargin());
return(0);
}
if (UseStopLoss) StopLossLevel = Bid + StopLoss * Point; else StopLossLevel = 0.0;
if (UseTakeProfit) TakeProfitLevel = Bid - TakeProfit * Point; else TakeProfitLevel = 0.0;
if(TradeIsBusy() < 0)
return(-1);
// refresh the market info
RefreshRates();
// recalculate the levels of StopLoss and TakeProfit
Ticket = OrderSend(Symbol(), OP_SELL, Lots, Bid, Slippage, StopLossLevel, TakeProfitLevel, "Sell(#" + MagicNumber + ")", MagicNumber, 0, DeepPink);
if(Ticket > 0) { // open a position
if(OrderSend(...) < 0)
{
Alert("Error opening position # ", GetLastError());
}
// set the trade context free
TradeIsNotBusy();
if (OrderSelect(Ticket, SELECT_BY_TICKET, MODE_TRADES)) {
Print("SELL order opened : ", OrderOpenPrice());
if (SignalMail) SendMail("[Signal Alert]", "[" + Symbol() + "] " + DoubleToStr(Bid, Digits) + " Open Sell");
} else {
Print("Error opening SELL order : ", GetLastError());
}
}
if (EachTickMode) TickCheck = True;
if (!EachTickMode) BarCount = Bars;
return(0);
}
}
if (!EachTickMode) BarCount = Bars;
return(0);
Here is the ea with that I think fixed the trade context busy problem but it's not working
I have this when compiling
Function "_IsTradeAllowed" is not referenced and will be removed from exp-file
and this when trying to run
2008.10.10 18:29:26 Cannot open file 'C:\Program Files\FXDD - MetaTrader 4\experts\PEA2.ex4' on the ,
any hints as to where I could have gone wrong
I have attached the tradecontext include file
Cheers
Beno