hi everyone!!! i trying to code a closing condition. When there is an open position and candle is closing in profit bigger then 10*points close trade. i try to attach the code with src but i only get attachment option. it says it right there to use src , cant see any bottom for it. as u see i have two problems to solve and asking for help thanks
//+------------------------------------------------------------------+
//| Check For Close Short Or Long Signal |
//+------------------------------------------------------------------+
void CloseSignal()
{
if(OrdersTotal()>1)
sellcl=false;
buycl=false;
double CC1=iClose(NULL, 0,1);
double profit= OrderProfit();
if(CC1&&profit>10)sellcl=true;
if(CC1&&profit>10)buycl=true;
}
//+------------------------------------------------------------------+
//| Check For Close Condition |
//+------------------------------------------------------------------+
void CloseConditon()
{
int res;
if(buycl)
{
res = CloseOrder(OP_BUY);
}
if(sellcl)
{
res = CloseOrder(OP_SELL);
}
return;
}
//+------------------------------------------------------------------+
//| Close Long Or Short Order |
//+------------------------------------------------------------------+
int CloseOrder(int mode)
{
if (OrdersTotal()
- Who can program this EA?
- How to do it?
- Coding help..How do I get indicator to filter instead of alert?
pieronetto: i try to attach the code with src but i only get attachment option.
SRC works fine.
Play videoPlease edit your post.
For large amounts of code, attach it.
//+------------------------------------------------------------------+ //| Check For Close Short Or Long Signal | //+------------------------------------------------------------------+ void CloseSignal() { if(OrdersTotal()>1)sellcl=false; buycl=false; double CC1=iClose(NULL, 0,1); double profit= OrderProfit(); if(CC1&&profit>10)sellcl=true; if(CC1&&profit>10)buycl=true; } //+------------------------------------------------------------------+ //| Check For Close Condition | //+------------------------------------------------------------------+ void CloseConditon() { int res; if(buycl){res = CloseOrder(OP_BUY);} if(sellcl){res = CloseOrder(OP_SELL);} return; } //+------------------------------------------------------------------+ //| Close Long Or Short Order | //+------------------------------------------------------------------+ int CloseOrder(int mode) { if (OrdersTotal()
- Don't double post
im sure src works fine
but all i have is the browse option on the end of this page
how i open the box with the src button like u show my in image 1, or i missing updates
i dont have any of this if i go to add new topic
i have the subjet line and the big box for text and browse for attachment
sorry need more advice on that topic
thanks
pieronetto:all i have is the browse option on the end of this page
What are you talking about? It's right below your post. Do you have Javascript disabled in your browser?
WHRoeder:
SRC works fine.
SRC works fine.
Play videoPlease edit your post.
For large amounts of code, attach it.
- Don't double post
sorry about double posting
and i needed a update on the explorer
everything works finenow
i will try to show the code in a bit
Lets try that again.
hi everyone!!!
i trying to code a closing condition.
When there is an open position and candle is closing in profit bigger then 10*points close trade.
so now i paste the code twice and is not there?????????
src still not working
last try
i pasted it in the box click insert
clicking add your comment
//+------------------------------------------------------------------+ //| Check For Close Short Or Long Signal | //+------------------------------------------------------------------+ void CloseSignal() { if(OrdersTotal()>1) sellcl=false; buycl=false; double CC1=iClose(NULL, 0,1); double profit= OrderProfit(); if(CC1&&profit>10)sellcl=true; if(CC1&&profit>10)buycl=true; } //+------------------------------------------------------------------+ //| Check For Close Condition | //+------------------------------------------------------------------+ void CloseConditon() { int res; if(buycl) { res = CloseOrder(OP_BUY); } if(sellcl) { res = CloseOrder(OP_SELL); } return; } //+------------------------------------------------------------------+ //| Close Long Or Short Order | //+------------------------------------------------------------------+ int CloseOrder(int mode) { if (OrdersTotal()<1) if (mode==OP_BUY) { RefreshRates(); OrderClose(OrderTicket(),OrderLots(),NormalizeDouble(Bid,Digits), 3); } if(mode==OP_SELL && OrderType()==OP_SELL) { RefreshRates(); OrderClose(OrderTicket(),OrderLots(),NormalizeDouble(Ask,Digits),3); } return(0); }
i pasted it in the box click insert
clicking add your comment

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