I need a help

 

dear

I ask abuot.....how i limited/place some point of a stop loss and atake profit in my new order tool that set a permanent case. because it take me aloot time to place it when i scalping

excuse me abuot my english

 
Hi Said Almuhager

Assalam galaikum u rahmat Allah

Try to place more details in your request and I'll try to help you

U assalam galaikum u rahmat Allah

Ais

 
Ais wrote >>
Hi Said Almuhager

Assalam galaikum u rahmat Allah

Try to place more details in your request and I'll try to help you

U assalam galaikum u rahmat Allah

Ais

Thank you very very mach abuot your atempit to help me . i`m wanted any script who are put specifical point stop loss and take profit from curent price that I restricted before when i go to scalping

look at the image

 

In a nutshell.....change the variables as you would like:


double lotSize = 1.0;
int takeProfitPips = 10;
int stopLossPips = 10;
int orderType = OP_BUY;

int start()
{
double price;
double takeProfit;
double stopLoss;
double orderColor;

if(orderType == OP_BUY){
price = Ask;
takeProfit = Ask + (takeProfitPips * Point);
stopLoss = Ask - (stopLossPips * Point);
orderColor = Blue;
}else if(orderType == OP_SELL){
price = Bid;
takeProfit = Bid - (takeProfitPips * Point);
stopLoss = Bid + (stopLossPips * Point);
orderColor = Red;
}

if(OrderSend(Symbol(), orderType,lotSize, price, 3, stopLoss, takeProfit, "Script Order", 0, 0, orderColor)){
Alert("Order Succeeded");
}else{
Alert("Order Failed");
}

return(0);
}

 

Hello

I want to ask about fourm for recomndations, where I can find this ?

 
jmca wrote >>

In a nutshell.....change the variables as you would like:

double lotSize = 1.0;
int takeProfitPips = 10;
int stopLossPips = 10;
int orderType = OP_BUY;

int start()
{
double price;
double takeProfit;
double stopLoss;
double orderColor;

if(orderType == OP_BUY){
price = Ask;
takeProfit = Ask + (takeProfitPips * Point);
stopLoss = Ask - (stopLossPips * Point);
orderColor = Blue;
}else if(orderType == OP_SELL){
price = Bid;
takeProfit = Bid - (takeProfitPips * Point);
stopLoss = Bid + (stopLossPips * Point);
orderColor = Red;
}

if(OrderSend(Symbol(), orderType,lotSize, price, 3, stopLoss, takeProfit, "Script Order", 0, 0, orderColor)){
Alert("Order Succeeded");
}else{
Alert("Order Failed");
}

return(0);
}

thank you Jmca

I`m do not andarstand how to make it! wear I go and wear I shell

excuse me look at ...

 
Almuhager:

thank you Jmca

I`m do not andarstand how to make it! wear I go and wear I shell

excuse me look at ...

Stick this file in the scripts folder.


Make a SELL ORDER version of this too.


Change variables to what u want (OP_SELL is for market SELL orders).


Don't forget to recompile each time u make a change.

Files:
buyoorder.mq4  1 kb
 
Assalam galaikum Said Almuhager


First, create 2 example scripts.
Follow the instructions to do it:
1. In main MetaTrader window press "F4" key to run MetaEditor.
2. In main MetaEditor window press "F4" key to run MetaTrader.
3. Press "F4" to run MetaEditor.
4. In MetaEditor close all windows.
5. Press "Ctrl-N" to create new file.
6. "Expert Advisor Wizard" dialog box with "Welcome ..." tab must appear.
7. Select "Script" option.
8. Push "Next" button.
9. "General properties of the Script program" tab must appear.
10. Type "AS_BUY" in "Name" input string.
11. Clear "Author" and "Link" input strings.
12. Push "Finish" button.
13. "AS_BUY.mq4" window must appear with following content:


int start()
  {
   return(0);
  } 


14. Replace "return(0);" expression by "Alert ( "Buy" ) ;":


int start()
  {
   Alert ( "Buy"  ) ;
  } 


15. Press "F5" to save and compile the file.
16. Repeat steps 5, 6, 7, 8, 9.
17. Type "AS_SELL" in "Name" input string.
18. Clear "Author" and "Link" input strings.
19. Push "Finish" button.
20. "AS_SELL.mq4" window must appear with following content:


int start()
  {
   return(0);
  } 


21. Replace "return(0);" expression by "Alert ( "Sell" ) ;":


int start()
  {
   Alert ( "Sell" ) ;
  } 


22. Press "F5" to save and compile the file.
23. Press "Ctrl-F6" to view "AS_BUY.mq4" window and "Ctrl-F6" again to return.
24. Press "F4" to run MetaTrader.
25. Press "Ctrl-N" to open "Navigator" window.
26. In "Navigator" window open "Scripts" list.
27. You'll see "AS_BUY" and "AS_SELL" scripts.
28. Make right click on "AS_BUY" name.
29. Select "Set hotkey" item in context menu.
30. "Navigator Hot Key" dialog box must appear.
31. Find "AS_BUY" name in the list.
32. Make double click on "Control" column of "AS_BUY" line.
33. Select "Alt" option.
34. Make double click on "Key" column of "AS_BUY" line.
35. Press "B" key.
36. Press "Enter" key.
37. Find "AS_SELL" name in the list.
38. Make double click on "Control" column of "AS_SELL" line.
39. Select "Alt" option.
40. Make double click on "Key" column of "AS_SELL" line.
41. Press "S" key.
42. Press "Enter" key.
43. Close "Navigator Hot Key" dialog box.
44. Press "Alt-B".
45. "Alert" window must appear with "Buy" message.
46. It means that script ""AS_BUY" runs correctly.
47. Press "Alt-S".
48. "Alert" window must appear with "Sell" message.
48. It means that script ""AS_SELL" runs correctly.
50. End of example.

Please let me know if you have done the example.

U assalam galaikum u rahmat Allah
Ais
Reason: