Any rookie question, so as not to clutter up the forum. Professionals, don't pass by. Nowhere without you - 6. - page 1153
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
The owls should plough on several pairs and preferably two owls per buy chart separately from the selves.
As it is, it opens to infinity
int _OrdersTotal=OrdersTotal();
for (int i=_OrdersTotal-1; i>=0; i--) {
if (OrderSelect(i,SELECT_BY_POS)) {
if (OrderMagicNumber() == Magic) {
if (OrderSymbol() == Symbol()) {
if (OrderType() == OP_BUY) {
}}}}}
if(MaPrevious>MaPrevious1)
{
ticket=OrderSend(Symbol(),OP_BUY,Lots,Ask,3,Ask-StopLoss*Point ,Ask+TakeProfit*Point, "macd sample",Magic,0,Green);
if(ticket>0)
{
if(OrderSelect(ticket,SELECT_BY_TICKET,MODE_TRADES))
Print("BUY order opened : ",OrderOpenPrice());
}
else
Print("Error opening BUY order : ",GetLastError());
return;
}
help who can
Good afternoon everyone!
I know that it is possible to implement signal output in the indicator:
a). When it appears on the current bar without waiting for it to close. In this case, after the close of the bar the signal can be canceled;
b). After the close of the bar on which the signal appears.
I am interested in variant a). How to implement the alert in an indicator, without waiting for the closure of the bar?
I tried to implement it as a choice of parameters on line 39 of the indicator code, but it did not work. How to do it correctly?
extern int shift = 0; // on which bar the signal is considered: 0 - on the current bar; 1 - on the closed bar
I would be very grateful for help!
Good afternoon everyone!
I know that it is possible to implement signal output in the indicator:
a). When it appears on the current bar without waiting for it to close. In this case, after the close of the bar the signal can be canceled;
b). After the close of the bar on which the signal appears.
I am interested in variant a). How to implement the alert in an indicator, without waiting for the closure of the bar?
I tried to implement it as a choice of parameters on line 39 of the indicator code, but it did not work. How to do it correctly?
extern int shift = 0; // on which bar the signal is considered: 0 - on the current bar; 1 - on the closed bar
I would be very grateful for your help!
I got it approximately like this
I have removed some unnecessary things. I have simplified some things
This is more or less what I got.
I removed some unnecessary things. Simplified some things.
Thank you very much. I'll give it a try.
This is more or less what I got.
I removed some unnecessary things. Simplified some things.
It's unfortunate, but it doesn't work. I tried it on M5 timeframe to check it quicker. The signal only appeared when the bar was closed and not when the averages were crossed on the current bar. Testing on large frames.
If we uncomment the remaining lines in OnStart() we get "newObjArray - parameter conversion not allowed".
Two questions: why, and how to fix it?
It's unfortunate, but it doesn't work. Tried it on M5 timeframe to check faster. The signal appeared only after the bar was closed and not when the averages were crossed on the current bar. I have tested it on large timeframes.
Looks like we just don't understand each other.
Hello friends.
How to make stop loss, tekprofit and trailing values to be shown as a percentage instead of pips.
This formula is too cluttered and does not work at all
StopLoss=NormalizeDouble(Bid-(Bid-TrailingStop)/100*TRAL_PERCENT,Digits);
I would like to have the simplest form of percentage.
Double Stoploss = 0.05;
--------
Profit=Bid-Stoploss in percents (it is a messy example, but just for clarity)
Thank you.
Hello friends.
How to make the stop loss, tekprofit and trailing values to be displayed as a percentage instead of pips.
This formula is too cluttered and does not work at all
StopLoss=NormalizeDouble(Bid-(Bid-TrailingStop)/100*TRAL_PERCENT,Digits);
I would like to have the simplest form of percentage.
Double Stoploss = 0.05;
--------
Profit=Bid-Stoploss in percents(it is a messy example, but just for clarity)
Thank you.
A sloppy example leads to a sloppy answer. To understand it, you need to understand what the percentage is measured from.