Any rookie question, so as not to clutter up the forum. Professionals, don't pass by. Nowhere without you - 6. - page 447

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
No it does not. I will explain - your forum is like a hope for the last competent stronghold of prog. and insertion of size - that's how the writing PERIOD_W1 sees itbut neither use of size nor use of fixed datums in the form of dates get any desired effect. I posted a specific question about Friday - by the way your code doesn't compile because it says 'version' - unknown property, so if you don't know how to put DayOfWeek and 5 (Friday's number) into the code other options won't help .
Please paste your variant in my indicator code and compile it. and post the corrected indicator in clear text not as a file. Comrade Venin gave me uncompilable code and no answer.
#property indicator_separate_window
#property indicator_buffers 1
#property indicator_color1 Lime
//--------------------------------------------------------------------
double Buffer[];
//--------------------------------------------------------------------
int init()
{
SetIndexStyle(0,DRAW_HISTOGRAM, EMPTY, 2);
SetIndexBuffer(0,Buffer;)
return(0);
}
// -------------------------------------------------------------------
int deinit()
{
return(0);
}
//--------------------------------------------------------------------
int start()
{
int StartBar = Bars - IndicatorCounted() - 1;
for(int i = StartBar; i >= 0; i--)
{
if(TimeDayOfWeek(TimeCurrent())==5) //Friday
if(TimeDayOfWeek(Time[i]) < TimeDayOfWeek(Time[i+1])
Buffer[i] = 0;
else
Buffer[i] = Buffer[i+1];
if(Close[i]>Close[i+1]&&Close[i+1]>=Close[i+2]){/if both the current and previous movements are increasing
Buffer[i] += NormalizeDouble((Close[i] - Close[i+1])/Point,0);}
if(Close[i]<Close[i+1]&&Close[i+1]<Close[i+2]){// if the current and previous movement goes down
Buffer[i] += NormalizeDouble((Close[i+1] - Close[i])/Point,0);}
if(Close[i]>Close[i+1]&&Close[i+1]<Close[i+2]){//if the current move is growing and the previous one is falling
Buffer[i] += NormalizeDouble((Close[i+1] - Close[i])/Point,0);}
if(Close[i]<Close[i+1]&&Close[i+1]>=Close[i+2]){// if the current movement goes down and the previous one is going up
Buffer[i] += NormalizeDouble((Close[i] - Close[i+1])/Point,0);}
}
return(0);
}
//---------------------------------------------------------------------
Please paste your variant in my indicator code and compile it. and post the corrected indicator in plain text not as a file. Comrade Venin gave me an uncompilable code and didn't say a word.
build 509
then what does the reference to a compliant library have to do with it?
Because:
Vitya, there's nothing to sort out here - the person wants global variables from one sandbox (EA with its libraries) to be visible in another sandbox(compiled library). :)))
Gentlemen, could you do me a favour and take a look at this piece of code and see if I have correctly entered the entry conditions for the 3 indicators.
Since I'm just learning a lot of things I don't understand.
E_ma=iMA(Symbol(),TimeFrame,period_ema,0,MODE_EMA,PRICE_CLOSE,1);
Cloce =iClose(Symbol(),PERIOD_H1,1);
e_ma=iMA(Symbol(),timeframe,period_ema,0,MODE_EMA,PRICE_CLOSE,1);
cloce =iClose(Symbol(),PERIOD_M15,1);
bbUP=iCustom(Symbol(),PERIOD_M5,"Bollinger Bands",BandsPeriod,BandsShift,BandsDeviations,1,0);
bbDOWN=iCustom(Symbol(),PERIOD_M5, "Bollinger Bands",BandsPeriod,BandsShift,BandsDeviations,2,0);
if(OrdersTotal()==0 && CountBuy()==0 && CountSell())
{
if(Cloce >E_ma && cloce >e_ma)
{
if(Ask<=bbDOWN)
ticket=OrderSend(Symbol(),OP_BUY,Lots,Ask,Slippage,0,0,",Magic,0,Green);
if(ticket>0)
{
TP = NormalizeDouble(Ask + TakeProfit * Point, Digits);
SL = NormalizeDouble(Ask-StopLoss * Point, Digits);
OrderModify(ticket, OrderOpenPrice(), SL, TP, 0);
}
}
else
if(Cloce <E_ma && cloce <e_ma)
{
if(Bid>=bbUP)
ticket=OrderSend(Symbol(),OP_SELL,Lots,Bid,Slippage,0,0,",Magic,0,Red);
if(ticket>0)
{
TP = NormalizeDouble(Bid - TakeProfit * Point, Digits);
SL = NormalizeDouble(Bid+StopLoss* Point, Digits);
OrderModify(ticket, OrderOpenPrice(), SL, TP, 0);
}
}
}
return(0);
Correct me if something is wrong, compiles without errors, but in the testor orders do not open. Because? where a mistake in the condition. How to write it correctly, I do not understand yet.someone on the fingers explain PLEASE!!!
This is all wrong, how to define Friday on the story, I don't know.
You removed the zeroing of the weekly cycle if(TimeDayOfWeek(Time[i]) < TimeDayOfWeek(Time[i+1])) and replaced it with if(TimeDayOfWeek(TimeCurrent())==5) //Friday maybe if these functions work together somehow it might work. I may have tried a hundred different things. i think it's easy to show multitime readings with weekly timeframes on lower timeframes. i still can't find a solution.
Yes, you removed the zeroing of the weekly cycle if(TimeDayOfWeek(Time[i]) < TimeDayOfWeek(Time[i+1])) and replaced it with if(TimeDayOfWeek(TimeCurrent())==5) //Maybe if these functions are somehow together they will work. I've probably tried hundreds of variants. i think it's easy to show multitime readings with weekly timeframe on lower timeframes. i still can't find a solution.
Here's an idea, open a new weekly bar - reset the buffer to zero, then accumulate your points
Make Ticket an array Ticket[5], store all 5 tickets in it. When closing, cycle through all the tickets accordingly.
How do I roughly implement this? The other functions I'm familiar with, but with orders and arrays I don't quite have an understanding yet.
It's something like this, I guess