H
> What I am looking for is the code, that after the price has reached this area, I wish to enter a limit order to buy two pips above this price.
That may be too close to market for a pending order - see MarketInfo function for the pair in question, checking the MODE_STOPLEVEL value
-BB-
Hi everyone,
Looking to buy in this scenario. The price has moved to the bottom of the last twenty days. This code being:
(Ask<(Low[iLowest(NULL,0,MODE_LOW,20,1)])).
What I am looking for is the code, that after the price has reached this area, I wish to enter a limit order to buy two pips above this price.
To exit the position, I wish to sell, two pips below the highest high of the last twenty bars. Meaning after the price has reached the highest high of the last twenty days, exit two pips lower than the highest high of the last twenty days.
Thank you in advance for any help.
Best Trading to all.
Huckleberry
I didn't check your code to see if it is correct, but assuming it is here is some generic entry buy code. Obviously you have to set all the values (stop, expire, lots, etc.) and make sure you are on the right timeframe assuming you don't specify below.
int ticket;
if(Ask<(Low[iLowest(NULL,0,MODE_LOW,20,1)]))
{
ticket=OrderSend(Symbol(),OP_BUYSTOP,Lots,Ask+2*Point,3,Stop,TakeProfit,"EAname",MagicNum,OrderExpire,Color);
}
![MQL5 - Language of trade strategies built-in the MetaTrader 5 client terminal](https://c.mql5.com/i/registerlandings/logo-2.png)
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
Hi everyone,
Looking to buy in this scenario. The price has moved to the bottom of the last twenty days. This code being:
(Ask<(Low[iLowest(NULL,0,MODE_LOW,20,1)])).
What I am looking for is the code, that after the price has reached this area, I wish to enter a limit order to buy two pips above this price.
To exit the position, I wish to sell, two pips below the highest high of the last twenty bars. Meaning after the price has reached the highest high of the last twenty days, exit two pips lower than the highest high of the last twenty days.
Thank you in advance for any help.
Best Trading to all.
Huckleberry