Thread: How to code?
View Single Post
  #10 (permalink)  
Old 12-22-2005, 03:35 PM
codersguru's Avatar
codersguru codersguru is offline
Senior Member
 
Join Date: Oct 2005
Posts: 987
codersguru has a spectacular aura aboutcodersguru has a spectacular aura aboutcodersguru has a spectacular aura about
Arrow SL & TP

Quote:
Originally Posted by jdun
Could someone tell me the code for stop loss and tp. I need to add it to this EA.
jdun,

The code of SL & TP has already written in this EA:
Look at these lines:

PHP Code:
if (Symbol()=="GBPUSD") {
      
PipsForEntry13;
      
TrailingStop 40;
      
TakeProfit 45
      
InitialStopLoss=33;
    } else    if (
Symbol()=="EURUSD") {
      
PipsForEntry13;
      
TrailingStop 30;
      
TakeProfit 45;
      
InitialStopLoss=23;
    } else    if (
Symbol()=="USDCHF") {
      
PipsForEntry13;
      
TrailingStop 30;
      
TakeProfit 45;
      
InitialStopLoss=15;
    } else {      
      
PipsForEntry13;
      
TrailingStop 30;
      
TakeProfit 45;
      
InitialStopLoss=30;
    } 
If you want to make SL & TP external variables which you can set, you have to comment the above lines of code and uncomment these lines:

PHP Code:
/*
extern int PipsForEntry= 5;
extern double TrailingStop = 40;
extern double TakeProfit = 120;
extern double InitialStopLoss=50;
*/ 
__________________
Hope it helps !
Coders' Guru
Senior MQL programmer:
www.xpworx.com/custom.htm
Reply With Quote