[ARCHIVE!] Any rookie question, so as not to clutter up the forum. Professionals, don't pass by. Can't go anywhere without you - 4. - page 181
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
Afternoon! "double x;" code that would remember the variable "x" after the terminal is reloaded. Thank you.
read after reboot
Hello, I would like to ask if I can trust this broker? I just like the quality of the quotes provided and the spread is negligible.
I WOULD LIKE TO ASK IF I CAN TRUST THIS BROKER. https://lh-broker.ru/?utm_source=babyforex&utm_medium=banner240400&utm_campaign=pervyi_bezdepositnyi
I do not know where to put this kind of message and I don't see the point in creating a new topic.
I do not want to go to the sauna, for obvious reasons.
if (((Ask>=OrderTakeProfit()) && (OrderType() == OP_BUY)) {x=1;}
if((Bid<=OrderTakeProfit()) && (OrderType() == OP_SELL)) {y=1;}
if(Hour()==00:00) {x=0;y=0;}
Add BUY x=0; SELL y=0;
Thank you very much. Seems to be just the right thing.
Help) What is the bug in the code) in the tester all is fine) and in the demo all is dead) no one position does not open) and no errors) not how many days like this) here is the code)
extern inttern Tenkan=5;extern int dd=9;
extern int int slowing=3;
extern int kk=9;
extern inttern UrovenUp=56;
extern double TakeProfit=100;
extern double Lots=3;
extern double StopLoss=100;
int start()
{double MY,priceBuy,priceBuy2,Ich,D,K,K1;
double Cc1,C2,C3,C4;
int ticket;
MY=(Open[0] + Close[0] )/2;
Ich=((Open[iHighest(NULL, 0, MODE_OPEN, Tenkan)]) +
(Close[iLowest(NULL, 0, MODE_CLOSE, Tenkan)]))/2;
D=(iStochastic(NULL,0,kk,dd,slowing,MODE_SMA,0,MODE_SIGNAL,0))
K=(iStochastic(NULL,0,kk,dd,slowing,MODE_SMA,0,MODE_MAIN,0))
K1=(iStochastic(NULL,0,kk,dd,slowing,MODE_SMA,0,MODE_MAIN,1))
Cc1=Close[2] < Close[1];
C2=Close[0] > Close[1];
C3=K>K1;
C4=D<UrovenUp;
//Buy and sell price condition//
priceBuy=MarketInfo(Symbol(),MODE_ASK);
priceBuy2=MarketInfo(Symbol(),MODE_BID);
//condition to buy//
{if (MY > Ich && Cc1 && C2 && C3 && C4)
//ticket=OrderS³; //ticket=OrderS³; //condition for buying and selling//
{ticket=OrderSend(Symbol(),OP_BUY,Lots,priceBuy,3,priceBuy2-StopLoss*Point,priceBuy2+TakeProfit*Point,
"My baby",123453,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(0);
}
}
}
I'm trying to figure out the iCustom() function.
I wrote a signal indicator that analyses the crossing of two MAs and gives a signal 1 or 2 - buy or sell. Here is its code:
I tried to write an Expert Advisor that trades by these signals using iCustom, but it does not work. Sig gives me a value of 0.
Please explain what I did wrong and what should be done correctly.
Thank you.
I'm trying to figure out the iCustom() function.
I wrote a signal indicator that analyses the crossing of two MAs and gives a signal 1 or 2 - buy or sell. Here is its code:
I tried to write an Expert Advisor that trades by these signals using iCustom, but it does not work. Sig gives me a value of 0.
Please explain what I did wrong and what should be done correctly.
Thank you.
First, read more details about iCustom(). It works only with indicator buffers.
There are no buffers in your signal indicator (0), therefore, you cannot pull data from it. How can iCustom() know that you need a simple int variable from the indicator?
reading after a reboot
Thank you! Sorted it out.
OrderCloseBy.
Who can explain why this situation occurs.
The top order which is a blue line Buy - 0.01
The second order the bottom Sell - 0.02
At a point where ordersCloseBy() Yellow arrow on the chart was called. On the first order it was -3 on the second +4.
After the function has been called, I expect the first one to be closed at 0 and the second one to be +1.
But it turns out that
The first order closed in 0 - line 6. And the second order closed at -1.10
Where did this -1.10 come from? Because I closed the whole minus as the total profit of two orders in +. In +1 in the example!