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
On page 76...
Thank you
The isTradeTimeInt() function.
This function returns a flag to allow timed trading. The returned value is true or false. Function isTradeTimeInt() is similar to function isTradeTimeString() by the principle of time interval recognition, i.e. the trade start time can be both larger (time interval within a day) and smaller (time interval in different days). Function isTradeTimeInt() accepts the following optional parameters:
Examples of how to use isTradeTimeInt().
SZY. Attached is a script to test the isTradeTimeInt() function.
Updated list of features with brief descriptions and links...
The isCloseLastPosByStop() function.
This function returns a flag to close the last position by stop. Flag is up - True - StopLoss has triggered. Flag lowered - False - position has been closed for another reason. More accurate selection of positions to be taken into account is set by external parameters:
Hello
Trying to use your function for my own purposes. Small working Expert Advisor. Only sells and closes, one position. Sometimes it catches several stoplosses in a row. I want to change sell conditions after first stop, Expert Advisor opens positions but does not close them. Please tell me what I am doing wrong ?
..........................................................
if ( isCloseLastPosByStop(NULL,OP_SELL, MagicNamber) == 0){
if ( (StochK_0<StochD_1) && (StochD_1 > 80) ) // 1st Sell Slowly
ticket=OrderSend(Symbol(),OP_SELL,Lots,Bid,3,Bid+SL*Point,0, "My EXP", MagicNamber,0,Green); // sell
OrderSelect(0, SELECT_BY_POS);
if (OrderSelect(0, SELECT_BY_POS)==true )
Print("SELECT_BY_POS");
else
Print("failed to select error : ",GetLastError());
RefreshRates();
if((StochK_0<30)&& (StochD_1 < 30))
OrderClose(OrderTicket(),OrderLots(),Ask,3,Violet);
}
else
if ( isCloseLastPosByStop(NULL,OP_SELL, MagicNamber) == 1)
{
if ((StochK_0<StochD_1) && (StochK_0 < 60) && (StochD_1 < 60) )
ticket=OrderSend(Symbol(),OP_SELL,Lots,Bid,3,0,0, "My EXP", MagicNamber,0,Green); //
...........................
Expert opens positions, but does not close them.
Print StochK_0 and StochD_1 variables. Maybe they take values that do not fall under your closing conditions.
to KimIV
Hello, could you please help to convert this cluster indicator into a function with the same drawing and + Pair change rate values return (upper right corner) by input parameter - Pair name. I thank you in advance.
P.S..... I've been struggling for a week now
And how do we express in the code that at the beginning of any hour, at the first second we open two differently directed positions, and at the last second of the hour we close the failed order?
What if there isn't one, first and last second?