No. The gist of my idea: If there is a sharp fall, the pound rolls back a couple of pips and if there is a strong rise too. If the price went up 30 pips in 5 min, you have to sell with a T/P of only 3 pips. And vice versa :))) Buy when the price goes down, sell when it rises... Help, Roman...
if(Bid - iOpen(NULL,0,0)>=Delta*Point)//Цена выросла на больше или = Delta пунктов//продаем-{ticket=OrderSend(Symbol(),1,Lots,Bid,3,Bid+StopLoss*Point,Bid-TakeProfit*Point,
"продал",MagicNumber,22222,Red);
if(ticket<0){Print("Ошибка открытия ордера SELL #",GetLastError());return(0);}}//-------------------------------------------------------------------------if(iOpen(NULL,0,0)-Bid >Delta*Point)//цена упала более дельты - покупаем{ticket=OrderSend(Symbol(),OP_BUY,Lots,Ask,3,Bid-StopLoss*Point,Ask+TakeProfit*Point,
"Купил",MagicNumber,11111,Green);
if(ticket<0){Print("Ошибка открытия ордера BUY #",GetLastError());return(0);}}
One more thing. How to fix this code, so that transactions are performed as a percentage of the deposit? How to use the Percent function or something like..... but in this code how? :
int start()
{
if (Ask - iOpen(NULL,0,0)>Delta*Point) //Цена выросла больше Delta пунктов - продаем!!!
//продаем-
{
ticket=OrderSend(Symbol(),OP_SELL,Lots,Bid,3,Bid+StopLoss*Point,Bid-TakeProfit*Point,"Продал");
}
//-------------------------------------------------------------------------
if (iOpen(NULL,0,0)-Bid >Delta*Point) //цена упала больше Delta пунктов - покупаем!!!
{
ticket=OrderSend(Symbol(),OP_BUY,Lots,Ask,3,Bid-StopLoss*Point,Ask+TakeProfit*Point,"Купил");
}
//----
return(0);
}
extern int Percent=10;
//-----
int start()
{
if(OrdersTotal()!=0) return; //Выполнять только одну сделку.
//---
if (Ask - iOpen(NULL,0,0)>=Delta*Point) //Цена выросла больше Delta пунктов - продаем!!!
//продаем-
{
ticket=OrderSend(Symbol(),OP_SELL,Percent,Bid,3,Bid+StopLoss*Point,Bid-TakeProfit*Point,"Продал");
}
//-------------------------------------------------------------------------
if (iOpen(NULL,0,0)-Bid >=Delta*Point) //цена упала больше Delta пунктов - покупаем!!!
{
ticket=OrderSend(Symbol(),OP_BUY,Percent,Ask,3,Bid-StopLoss*Point,Ask+TakeProfit*Point,"Купил");
}
//----
return(0);
}
Allow the use of cookies to log in to the MQL5.com website.
Please enable the necessary setting in your browser, otherwise you will not be able to log in.
You are signed in. Two-factor authentication has been disabled. Set it up again and scan a new QR code, or continue with two-factor authentication disabled.
Delta seems to work...
I need to sell when Delta points are rising and buy when Delta points are falling...
But it was the opposite from the beginning!
If there is a sharp fall, the pound rolls back a couple of pips and if there is a strong rise too.
If the price went up 30 pips in 5 min, you have to sell with a T/P of only 3 pips. And vice versa :)))
Buy when the price goes down, sell when it rises...
Help, Roman...
Thank you so much, it's working now :)
I mean does it trade or does it profit (which is doubtful)?
Thank you very much, now it works :)
What do you mean, is it trading or profiting (which is doubtful)?
I have my terms and conditions :)
How to use the Percent function or something like..... but in this code how? :
int start() { if (Ask - iOpen(NULL,0,0)>Delta*Point) //Цена выросла больше Delta пунктов - продаем!!! //продаем- { ticket=OrderSend(Symbol(),OP_SELL,Lots,Bid,3,Bid+StopLoss*Point,Bid-TakeProfit*Point,"Продал"); } //------------------------------------------------------------------------- if (iOpen(NULL,0,0)-Bid >Delta*Point) //цена упала больше Delta пунктов - покупаем!!! { ticket=OrderSend(Symbol(),OP_BUY,Lots,Ask,3,Bid-StopLoss*Point,Ask+TakeProfit*Point,"Купил"); } //---- return(0); }extern int Percent=10; //----- int start() { if(OrdersTotal()!=0) return; //Выполнять только одну сделку. //--- if (Ask - iOpen(NULL,0,0)>=Delta*Point) //Цена выросла больше Delta пунктов - продаем!!! //продаем- { ticket=OrderSend(Symbol(),OP_SELL,Percent,Bid,3,Bid+StopLoss*Point,Bid-TakeProfit*Point,"Продал"); } //------------------------------------------------------------------------- if (iOpen(NULL,0,0)-Bid >=Delta*Point) //цена упала больше Delta пунктов - покупаем!!! { ticket=OrderSend(Symbol(),OP_BUY,Percent,Ask,3,Bid-StopLoss*Point,Ask+TakeProfit*Point,"Купил"); } //---- return(0); }One more thing. How do you fix this code so that the trades are made as a percentage of the deposit?
The results are classified so try to get some knowledge yourself:
- There is a huge library of automatic lot calculations in the kodobase,
- I've got a lot of EAs out there, most of which are equipped with appropriate functions.