Any rookie question, so as not to clutter up the forum. Professionals, don't pass by. Nowhere without you - 6. - page 63
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
I see, more questions then:
You need to control the open time of the candle with the function : iTime
I tried to control the open time of a candlestick with this function: iTime
The order opens at the 15 o'clock candle...... but the 15 o'clock candle is often not the first one.
Before it, the earlier candlesticks had already been in contact with 1.3000.
And I need it to be before the 15 o'clock candlestick, which has crossed 1.3000.
Thank you.
sometimes newbies are stumped... exactly logic, simple human logic. and programming is rather linear. try to think of your conditions in one line.
Let me give you my idea graphically.
http://clip2net.com/s/5vbxUK
And how would you put this idea into one line?
Thank you.in time, in reverse order. That's how the program will analyse it.
Sorry - I don't quite understand your intention.
I'd appreciate it if you could write how it might look in code form...
Thank you.
Good afternoon everyone!
I would be very grateful to anyone who can tell me how to code such an idea.
The graph TF 5
At the moment bid is 1.3150
There is a price level - 1.3000.
The price goes down.
====================================
// If the price crosses 1.3000.
// If price first crosses 1.3000.
// If the price first crosses 1.3000 and the crossing is within the 15hour candle (i.e. 15:00,15:05.....15:55)
// Open a trade.
===================================
Thank you.this is just an idea without full implementation
it is only an idea without full implementation
Sorry - I don't quite understand your intention.
I'd appreciate it if you could write down what it might look like in code form...
Thank you.
It's still a long way to the code, you have to understand the principle, the algorithm.
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?
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.
I thank you in advance.