Should the entry line move tick for tick with the price of current candle? Seems it shouldn't be. Kinda impossible to choose en entry price if it never stops moving.
thx,
todd
thx,
todd
I Will Learn Coding in 1 Month - Give me the 80/20 of MT4 Coding 14 replies
Support and Resistance Trading Simplified 249 replies
Simplified Trailing Stop 0 replies
Simplified Version Of (Fast) Stochastic 2 replies
a software that can offer a simplified rate of any currency in your screen 0 replies
DislikedShould the entry line move tick for tick with the price of current candle? Seems it shouldn't be.Ignored
DislikedYes it moves, because
Entry Line = HH5/LL5 + 3 Pips + Spread
So since the Spread isn't fixed the line moves.
If you have another idea for entry point i'll implement it in the code
(I also don't like this line that move)
gspeIgnored
DislikedYes it moves, because
Entry Line = HH5/LL5 + 3 Pips + Spread
So since the Spread isn't fixed the line moves.
If you have another idea for entry point i'll implement it in the code
(I also don't like this line that move)
gspeIgnored
Quoting flyer415DislikedRight now you are calling DrawBreakLines on every tick. Why not just call it on a new bar similar to your DoAlerts call.
That way the line is only drawn once and not updated. It will have the spread that was measured at that point in time.Ignored
Dislikedin my opinion it shouldn't move, at the moment a new bar opens, and we get a valid signal, then based on those numbers (at that time) we should place the orders.
But i must admit, there's gonna be a slight difference because the spread changes so qucikly, that even an EA wouldn't be able to place it that quick (and ofcourse the processing time of your broker).Ignored
Dislikedi "fixed" it by changing some code (also alerts set to false is now working).
Attachment
couldn't send as attachment with a pm or email gspe, so hope you dont mind posting it hereIgnored
int start() { Comment("Spread: "+DoubleToStr(MarketInfo(Symbol(), MODE_SPREAD),0)); if (barStart < Time[0]) //start of new bar { barStart = Time[0]; GetPairGaps(TradePair, PairDigits, TradeRulesSymbol, TradeRulesColor); PrintPairDashboard(); if (DrawLines)DrawBreakLines(); if (SendAlert==true) DoAlerts(); } //---- return(0); }//End start()
int start() { GetPairGaps(TradePair, PairDigits, TradeRulesSymbol, TradeRulesColor); PrintPairDashboard(); if (DrawLines)DrawBreakLines(); if (isNewBar(PERIOD_H4) == true)// Check if there is a New Bar on chart { if(SendAlert)DoAlerts(); } //---- return(0); }//End start()
DislikedHi Indo,
the changing you did to code didn't work very well with Multi Pair Indy, since not every Pair get the tick at the same time.
So for example if you attach the Indy to EURUSD chart that is very active Pair at the begin of 4H Bar the Indy made the calculation for every Pair even if the Pair tick isn't updated.
...Ignored
GetPairGaps(TradePair, PairDigits, TradeRulesSymbol, TradeRulesColor); PrintPairDashboard(); if (DrawLines)DrawBreakLines();
if (isNewBar(PERIOD_H4) == true)// Check if there is a New Bar on chart { if(SendAlert)DoAlerts(); }
DislikedNo because the new bar is checked on the active chart, and because the PC is very fast to do maths there is the possibility that not all the Pairs are updated at same time.
I'm thinking about a good solution to this but haven't find yet
gspeIgnored
while (RefreshRates()==false) Sleep(100)
Dislikeddon't know for sure, but maybe something withlike here is explained: http://book.mql4.com/variables/predefinedInserted Codewhile (RefreshRates()==false) Sleep(100)
Maybe its not so bad afterall, i mean no tick = no tick. prices for Ask and Bid are from the latest update, so might not be such a problem? I like the fixed values betterIgnored
DislikedI'll try to implement this in the code.
Just to clarify:
The no tick is a big problem, since this involve all calculations, (not only the Spread) latest update was 4 Hours ago, so if we have no tick the function calculate all the value for the previous 4H Bar, so the check for new signal is not valid!
The Indy will be executed once and only once per 4H Bar.
gspeIgnored
DislikedEntry price is still moving with every tick. When the current bar closes, the lines and entry price etc need to be locked in until the next bar closes. It's becoming more difficult to even use this indicator the way it is.
It seems to be using the current bar in it's calculations rather then the previous 5 bars as it should.
thx,
toddIgnored
Dislikedthats why i changed it. levels should be calculated from setup bar not current bar..Ignored
DislikedYes, but evenwhile it is executed once per 4H bar, in the 4 hours before, all other currencies have had their ticks, so when the new calculation is done, it is based on those numbers, which can onlly mean a slight difference, right? .Ignored
DislikedNo, because if we don't have a tick we don't have a new Bar!
Let's see if this is more clear the bar are numerated:
Bar[0], Bar[1], ...., Bar[5],.....
We do our calculation on Bar[1]-Bar[5] not tick, fixed value High, Low, etc..
At the start of new 4H Bar Bar[0] become Bar[1] and other Bars follow, so we have new Bar[0] and do our calculation on Bar[1]-Bar[5] the new one.
So no tick means no new Bar[0]!!! Consequently all calculations are made on Old Bars!
Hope that now is more clear
gspeIgnored
if (barStart < Time[0]) //start of new bar { barStart = Time[0];
if (iTime( Symbolhere, PERIOD_H4, 0) == D'00:00'||D'04:00'||D'08:00'||D'12:00'||D'16:00'||D'20:00')
Dislikedclear now , so you should applyor your isNewBar function on every pair, before doing calculations.Inserted Codeif (barStart < Time[0]) //start of new bar { barStart = Time[0];
P.S. http://forum.mql4.com/9075
Maybe a comparison with iTime and time[0] . if iTime is equal or greater than time[o], continue calculation, or else .....sleep/return/?Ignored
DislikedYes exactly this is the way of do it.
The only Problem is that not all Platforms/Brokers/Users have the same Pairs, some Broker Doesn't offer some Pairs. So if we check iTime Time[0] for a pair that doesn't exist the Indicator will freeze MetaTrader.
So the first thing to do is to clear the Pairs List in order to be sure that contains only Paris that the Broker offers.
I'm working on it but i haven't finished yet
gspeIgnored
DislikedAre u using marketinfo with MODE_TRADEALLOWED for that?
this look useful: http://forum.mql4.com/ru/18517/page5 (well the code at least... i dont speak russianIgnored