An advisor that would follow the rate on a five-minute chart with conditions after launch: - page 7
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
{
if(OrdersTotal() !=0) return;
//----
if (iOpen(NULL,5,0)-Bid>Delta*Point) //The price has dropped more than Delta points
........
if(OrdersTotal ()!=0) return;
What about other people's orders (using other symbols and magicians)? In the tester, it will work, but if there is something else on the account besides this EA, the correct way is as follows
The function will return false if there is no position opened by the current symbol with the specified (passed to it) magician.
Imagine how confused he will be, that's why I wrote it in such a way that he would understand it better.
Both cases caught up, thank you very much.
Deals are not triggered under my conditions
Delta=30
It means I want my Expert Advisor to open position +-30 in pips. But it opens at 5-10 pips up and down, it is not clear....
Maybe there are some other simple solutions?
I have found one function
Distance=30 // Distance from current price to pending order price
Can it be implemented not only for pending orders?
The idea is the same: keep track of the current bar, its open price and if during a 5 min bar its price will either increase or decrease by, say, 30 pips from the open market of that 5 min bar, only then open a position......
My strategy does not work with pending orders.....
And you would post your whole code here. And see why Delta doesn't work...
Here is the whole code.....
Yes indeed. Delta.... does not work
Apparently, here it is necessary with signs (polarity) of a Delta to understand at buying and at sale, "for" in the code above, for example, at buying value(iOpen(NULL,0,0)-Ask all time will be negative. And the trade is opened at the open price of the bar (iOpen(NULL,0,0)-Ask>=Delta...
If you try it this way (buy) -
{
if(OrdersTotal()!=0) return; //Follow only one trade.
//----
if (Bid - iOpen(NULL,0,0)<=Delta*Point) //The price fell by less or = Delta points
//Null-tek instrument, 0-tek.chart, 0-tracking tek bar
{
ticket=OrderSend(Symbol(),OP_BUY,Lots,Ask,3,Bid-StopLoss*Point,Ask+TakeProfit*Point, "Buy",MagicNumber,11111,Green);
}
if (Ask - iOpen(NULL,0,0)>=Delta*Point) //The price rose by more or = Delta points
{
ticket=OrderSend(Symbol(),OP_SELL,Lots,Bid,3,Ask+StopLoss*Point,Bid-TakeProfit*Point, "Sold",MagicNumber,22222,Green);
}
//----
return(0);
}