Any rookie question, so as not to clutter up the forum. Professionals, don't pass by. Nowhere without you - 6. - page 64
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
Dear forum users, please help me very much.
if (TimeBar==Time[0]) return(0);
double MA1 = NormalizeDouble(iMA(NULL,TimeFrame_2,MA_Period_2,MA_Shift_2,MA_Method_2,Applied_Price_2,0),Digits); // where 0 is shift from the current bar by the specified number of periods back
//double MA21 = NormalizeDouble(iMA(NULL,timeframe_2,period_2,ma_shift_2,ma_method_2,applied_price_2,2),Digits);
double MA2 = NormalizeDouble(iMA(NULL,timeFrame_3,MA_Period_3,MA_Shift_3,MA_Method_3,Applied_Price_3,0),Digits);
//double MA31 = NormalizeDouble(iMA(NULL,timeframe_3,period_3,ma_shift_3,ma_method_3,applied_price_3,2),Digits)
double MA3 = NormalizeDouble(iMA(NULL,TimeFrame_4,MA_Period_4,MA_Shift_4,MA_Method_4,Applied_Price_4,0),Digits);
double OsMA = NormalizeDouble(iOsMA(NULL,TimeFrame_5,FastEMA_5,SlowEMA_5,SignalSMA_5,Applied_Price_5,0),Digits)
if (MaxOrders>b && Low[0]>=MathMax(MA1,MA2)&& Low[0]>MA3 && Ask>MathMax(MA1,MA2)+DeltaOpen*Point && Ask>MA3 && MA2<MA3 && MA1<MA3 && OsMA>0 && Trade)
{
if (OrderSend(Symbol(),OP_BUY,Lots,NormalizeDouble(Ask,Digits),Slippage,SL,TP, "Puria_1",Magic,0,Blue) ==-1) TimeBar=0;
else TimeBar=Time[0];
}
if (MaxOrders>s && High[0]<=MathMin(MA1,MA2) && High[0]<MA3 && Bid<MathMin(MA1,MA2)-DeltaOpen*Point && Bid<MA3 && MA1>MA3 && MA2>MA3 && OsMA<0 && Trade)
{
if (OrderSend(Symbol(),OP_SELL,Lots,NormalizeDouble(Bid,Digits),Slippage,SL,TP, "Puria_1",Magic,0,Red) ==-1) TimeBar=0;
else TimeBar=Time[0];
}
return(0);
With these conditions, the Expert Advisor opens a trade, say, on SELL, closes it on profit, and immediately opens another trade on SELL. How to prescribe in an EA, that when the signal is received, only one deal should open, i.e. one signal - one deal.
Thank you in advance.
1 variant - either check the deal condition so that: index 2 shows a buy signal and index 1 a sell signal, then at the opening of a bar with index 0 will open a sell deal.
The 2nd variant is to check the order history and compare the signal and order indices, if they coincide, then do not open any more orders.
Where and how is the TimeBar variable initialised?
Although it won't help you much in your case. I see the Trade variable in the conditions, so adjust the opening with it.
I've been struggling for two days now and can't figure it out. I need to find the lowest price for the last n bars, but not from the current bar, but from the bar received through the function. The function returns the index of the bar at which the order was opened. This is the bar from which we need to look back through the history for the n bars to find the lowest price. Below is my code, what is wrong with it?
like this
something like this.
Thank you very much! Tried to use this function too, but again in a loop, it turns out to be simple )))) Thanks again!
gyfto:
I have the following question. How do I intercept the mouse wheel, what winapi functions? Let me explain why. There is an int parameter in externs. You need to rotate the wheel to increase or decrease it.
When you find out how to do this, post it...
So far, that's just the way it's worked out:
As Vadim told me not to use hooks from under MT4, the platform doesn't like them, so I don't touch them. Probably for nothing)