Forex
Google
New signals service!

Go Back   Forex Trading > Metatrader Training > Metatrader 4 mql 4 - Development course > Questions


Register in Forex TSD!
Trading Systems Leaders in this forum (automated trading systems) are winning more than 3000 pips in a month (30000$ investing one lot every time).
Click here to register and get more information

Reply
 
LinkBack (2) Thread Tools Display Modes
  #871 (permalink)  
Old 11-29-2007, 06:10 PM
Junior Member
 
Join Date: Mar 2007
Posts: 6
pgtips is on a distinguished road
Question include file in code - variables not defined

Hi,

can anyone help, this must be simple but i'm too new to figure it out

I've come across a post for a 3 level exit posted back in 2005.

It's an includes file
Trailing file

I have a place pending order script and have added
Code:
#include <b-TLE_v.1.6.mqh>
#define MAGIC = 20051120;
extern color clModifyBuy = Aqua;
extern color clModifySell = Tomato;
extern bool UseSound = False;
extern string NameFileSound = "expert.wav";
in the top of the file and then inside int start() I have added the line
if (UseTrailing) TrailingPositions();

I've searched loads but can't find much more on it and for the life of me I cannot get my script to compile calling this. It works ok without adding te code.
Help really appreciated as it's driving me mad, i really can't figure why it isn't working. It keeps saying all the above are not defined.

Many thanks
Kevin
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #872 (permalink)  
Old 11-29-2007, 06:36 PM
faqcya's Avatar
Member
 
Join Date: Nov 2007
Posts: 35
faqcya is on a distinguished road
Hey Kevin nice Irish name,
Why are you trying to put this into a script and not an EA?
Scripts only run once and I don't believe a script could do a trailing stop. Try putting it into an EA.
__________________
"veni, vidi, vici." Julius Caesar
I came, I saw, I had milk and cookies.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #873 (permalink)  
Old 11-29-2007, 11:04 PM
ralph.ronnquist's Avatar
Senior Member
 
Join Date: Oct 2006
Posts: 280
ralph.ronnquist is on a distinguished road
@pgtips: change the second line to be only
PHP Code:
#define MAGIC 20051120 
i.e., no equal sign and no comma.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #874 (permalink)  
Old 11-30-2007, 03:03 AM
Junior Member
 
Join Date: May 2007
Posts: 16
cyberpasta is on a distinguished road
Some help for a newbie

Hi!!
Here is my first EA. Only for learning purpose. I've not coded good because today I was waiting a sell and the EA didn't open it on demo account and didn't onpen it on backtester.

The logic is symple, for sell, if price<iBands whith deviation=1, open sell at sellentry level (pivot-20 points) and viceversa for buy. Can you check if I've coded this logic right in sendOrder() function?
See the attach picture of the chart for today.

Here is my code:
Quote:
//+------------------------------------------------------------------+
//| EA4.mq4 |
//| Copyright © 2007. |
//| http://www.website.com |
//+------------------------------------------------------------------+
#property copyright "Copyright © 2007."
#property link "http://www.website.com"


//+------------------------------------------------------------------+
//| expert start function |
//+------------------------------------------------------------------+

//+------------------------------------------------------------------+
//---- input parameters
extern string Version="EA4";
extern int MagicNumber=12345;
extern string MONEY_MANAGEMENT="MONEY_MANAGEMENT";
extern bool UseMM=true;
extern double Risk=0.1;
extern double MinLots=0.1;
extern double MaxLots=100.0;
extern bool Micro=false;
extern double FixedLots=0.1;
extern string ORDER_SETTING="ORDER_SETTING";
extern int TakeProfit=40;
extern int StopLoss=30;
extern string PROFIT_PROTECT="PROFIT_PROTECT_SETTING";
extern int ProfitProtectStart=30;
extern int ProtectProfit=10;
extern int OverProtect=30;
extern string TRADING_HOURS="TRADING_HOURS";
extern int StartHour=8;
extern int EndHour=20;
extern bool UseAlert=false;


//---- GlobalVariable
double high,low,close,pivot,buystart,sellstart,tp,sl,tick et;
int ticketID,DayOfLastBuyTrade,DayOfLastSellTrade;
string Website="www.website.com";

//+------------------------------------------------------------------+
//| expert initialization function |
//+------------------------------------------------------------------+
int init(){
Comment("\n",Version,"\n" , Website,"\n", AccountCompany(),"\nAccount Number: ", AccountNumber(), "\nName: ", AccountName(), "\nServer: ", AccountServer(),"\nBalance: ", AccountBalance());
ticketID=NULL;
tp=TakeProfit*Point;
sl=StopLoss*Point;
setPivot();
MagicNumber=OrderMagicNumber();






return(0);
}
//+------------------------------------------------------------------+
//| expert deinitialization function |
//+------------------------------------------------------------------+
int deinit()
{
//----

//----
return(0);
}
//+------------------------------------------------------------------+
//| expert start function |
//+------------------------------------------------------------------+
void start(){
if(OrdersTotal()>0){
for(int i=0;i<=OrdersTotal()-1;i++){
OrderSelect(i, SELECT_BY_POS);
if (OrderMagicNumber() == MagicNumber){
if(OrderType()==0 || OrderType()==1){

if(((MarketInfo(Symbol(),MODE_BID) - OrderOpenPrice()) / MarketInfo(Symbol(),MODE_POINT) )>=ProfitProtectStart && OrderType()==0 && ticketID!=OrderTicket()){
OrderModify(OrderTicket(),OrderOpenPrice(),buystar t+(Point*ProtectProfit),OrderTakeProfit(),0,Blue);
ticketID=OrderTicket();
}
else if(((OrderOpenPrice() - MarketInfo(Symbol(),MODE_ASK)) / MarketInfo(Symbol(),MODE_POINT))>=ProfitProtectSta rt && OrderType()==1 && ticketID!=OrderTicket()){
OrderModify(OrderTicket(),OrderOpenPrice(),sellsta rt-(Point*ProtectProfit),OrderTakeProfit(),0,Blue);
ticketID=OrderTicket();
}
}
}
}
}
if(OrdersTotal()>0){
for(int j=0;j<=OrdersTotal()-1;j++){
OrderSelect(j, SELECT_BY_POS);
if (OrderMagicNumber() == MagicNumber){
if(OrderType()==0 || OrderType()==1){
if (((MarketInfo(Symbol(),MODE_BID) - OrderOpenPrice()) / MarketInfo(Symbol(),MODE_POINT) )>=OverProtect && iRSI(NULL,0,3,PRICE_CLOSE,0)>90 && OrderType()==0) {
OrderClose(OrderTicket(),OrderLots(),Bid,2,Violet) ;//Buy case
}
if (((OrderOpenPrice() - MarketInfo(Symbol(),MODE_ASK)) / MarketInfo(Symbol(),MODE_POINT))>=OverProtect && iRSI(NULL,0,3,PRICE_CLOSE,0)<10 && OrderType()==1){
OrderClose(OrderTicket(),OrderLots(),Ask,2,Violet) ;}//Sell case
}
}
}
}



if(Hour()>=StartHour && Minute()>=0 && Hour()<=EndHour){
setPivot();
if(OrdersTotal()>0){
for(int k=0;k<=OrdersTotal()-1;k++){
OrderSelect(k, SELECT_BY_POS);
if (OrderMagicNumber() != MagicNumber){
if(OrderType()==0 || OrderType()==1 || OrderType()==2 || OrderType()==3 || OrderType()==4 || OrderType()==5){
sendOrder();
}
}
}
}
if (OrdersTotal()==0){
sendOrder();
}

}

if(Hour()==EndHour && Minute()==1 && OrdersTotal()>0){
CloseAllOrder();
}

}





void setPivot(){

high=iHigh(NULL,PERIOD_D1,1);
low=iLow(NULL,PERIOD_D1,1);
close=iClose(NULL,PERIOD_D1,1);
pivot=NormalizeDouble((high+low+close)/3,4);
buystart=pivot+0.0020;
sellstart=pivot-0.0020;

}

double getLotSize(){

double lot;

if(UseMM){
if(!Micro){
lot = NormalizeDouble((Risk*AccountBalance())/1000,1);
if(lot>MaxLots){lot=MaxLots;}
else if(lot<MinLots){lot=MinLots;}
}
else{
lot = NormalizeDouble((Risk*AccountBalance())/1000,2);
if(lot>MaxLots){lot=MaxLots;}
else if(lot<MinLots){lot=MinLots;}
}

return(lot);
}
else{
return(FixedLots);
}
}

void sendOrder(){
if(TimeDayOfYear(TimeCurrent())!=DayOfLastBuyTrade && Ask==buystart && Ask>iBands(NULL,0,20,1,0,PRICE_CLOSE,MODE_UPPER,0) ){
ticket=OrderSend(Symbol(),OP_BUY,getLotSize(),Ask, 2,buystart-sl,buystart+tp,"EA4",MagicNumber,0,CLR_NONE);
DayOfLastBuyTrade=TimeDayOfYear(TimeCurrent());
if(ticket > 0)
{
if(OrderSelect(ticket, SELECT_BY_TICKET, MODE_TRADES)) {
Print("BUY order opened : ", OrderOpenPrice());
if (UseAlert){Alert("EA4 Opened Buy on ",Symbol()," at ",OrderOpenPrice());}}
}
else
Print("Error opening BUY order : ", GetLastError());
}



else if(TimeDayOfYear(TimeCurrent())!=DayOfLastSellTrad e && Bid==sellstart && Bid<iBands(NULL,0,20,1,0,PRICE_CLOSE,MODE_LOWER,0) ){
ticket=OrderSend(Symbol(),OP_SELL,getLotSize(),Bid ,2,sellstart+sl,sellstart-tp,"EA4",MagicNumber,0,CLR_NONE);
DayOfLastSellTrade=TimeDayOfYear(TimeCurrent());
if(ticket > 0)
{
if(OrderSelect(ticket, SELECT_BY_TICKET, MODE_TRADES)){
Print("SELL order opened : ", OrderOpenPrice());
if (UseAlert){Alert("EA4 Opened Sell on ",Symbol()," at ",OrderOpenPrice());}}
}
else
Print("Error opening SELL order : ", GetLastError());
}



else{}



}



void CloseAllOrder()
{
int total = OrdersTotal();
for (int cnt = OrdersTotal()-1 ; cnt < total ; cnt++)
{
OrderSelect(0,SELECT_BY_POS,MODE_TRADES);
if (OrderMagicNumber() == MagicNumber) {
if(OrderType()==OP_BUY){
OrderClose(OrderTicket(),OrderLots(),Bid,2,Violet) ;}

if(OrderType()==OP_SELL) {
OrderClose(OrderTicket(),OrderLots(),Ask,2,Violet) ;}

if(OrderType()==OP_SELLSTOP || OrderType()==OP_SELLLIMIT || OrderType()==OP_BUYSTOP || OrderType()==OP_BUYLIMIT) {
OrderDelete(OrderTicket());}
}
}

}

Last edited by cyberpasta; 11-30-2007 at 03:24 AM.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #875 (permalink)  
Old 11-30-2007, 11:42 AM
Junior Member
 
Join Date: Oct 2006
Posts: 12
ejlamarque is on a distinguished road
Exclamation MTF indicator code inside EA

Would someone tell me where I can to find some information reward how write the code of a MTF indicator inside a EA??? Thank you
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #876 (permalink)  
Old 11-30-2007, 11:52 AM
Member
 
Join Date: Nov 2006
Posts: 90
k3iroll is on a distinguished road
Hi cyberpasta,

Shouldnt it be OrderSend() instead of sendOrder() ...

k3iroll
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #877 (permalink)  
Old 11-30-2007, 12:23 PM
Junior Member
 
Join Date: May 2007
Posts: 16
cyberpasta is on a distinguished road
senOrder() is a custom function called from start() if hour is betwen trading hours, that is no the problem.
Anyway, Thanks for your reply.
I have anotrher question. I've modified BBands stop, I'd like that the new bar in histogram dosen't draw till the current candle close, how can I code this?
Attaced is the BBands stop modified.
Quote:
//+------------------------------------------------------------------+
//| BBands_Stop_v1.mq4 |
//| Copyright © 2006, TrendLaboratory Ltd. |
//| TrendLaboratory : TrendLaboratory |
//| E-mail: igorad2004@list.ru |
//+------------------------------------------------------------------+
#property copyright "Copyright © 2006, TrendLaboratory Ltd."
#property link "http://finance.groups.yahoo.com/group/TrendLaboratory"

#property indicator_separate_window
#property indicator_buffers 6
#property indicator_color1 RoyalBlue
#property indicator_color2 Red
#property indicator_color3 RoyalBlue
#property indicator_color4 Red
#property indicator_color5 RoyalBlue
#property indicator_color6 Red
//---- input parameters
extern int Length=20; // Bollinger Bands Period
extern int Deviation=2; // Deviation was 2
extern double MoneyRisk=1.00; // Offset Factor
extern int Signal=1; // Display signals mode: 1-Signals & Stops; 0-only Stops; 2-only Signals;
extern int Line=1; // Display line mode: 0-no,1-yes
extern int Nbars=1000;
//---- indicator buffers
double UpTrendBuffer[];
double DownTrendBuffer[];
double UpTrendSignal[];
double DownTrendSignal[];
double UpTrendLine[];
double DownTrendLine[];
extern bool SoundON=true;
bool TurnedUp = false;
bool TurnedDown = false;
//+------------------------------------------------------------------+
//| Custom indicator initialization function |
//+------------------------------------------------------------------+
int init()
{
string short_name;
//---- indicator line

SetIndexBuffer(0,UpTrendBuffer);
SetIndexBuffer(1,DownTrendBuffer);
SetIndexBuffer(2,UpTrendSignal);
SetIndexBuffer(3,DownTrendSignal);
SetIndexBuffer(4,UpTrendLine);
SetIndexBuffer(5,DownTrendLine);
SetIndexStyle(0,DRAW_NONE,0,1);
SetIndexStyle(1,DRAW_NONE,0,1);
SetIndexStyle(2,DRAW_NONE,0,1);
SetIndexStyle(3,DRAW_NONE,0,1);
SetIndexStyle(4,DRAW_HISTOGRAM,0,4);
SetIndexStyle(5,DRAW_HISTOGRAM,0,4);
SetIndexArrow(0,159);
SetIndexArrow(1,159);
SetIndexArrow(2,108);
SetIndexArrow(3,108);
IndicatorDigits(MarketInfo(Symbol(),MODE_DIGITS));
//---- name for DataWindow and indicator subwindow label
short_name="BBands Stop("+Length+","+Deviation+")";
IndicatorShortName(short_name);
SetIndexLabel(0,"UpTrend Stop");
SetIndexLabel(1,"DownTrend Stop");
SetIndexLabel(2,"UpTrend Signal");
SetIndexLabel(3,"DownTrend Signal");
SetIndexLabel(4,"UpTrend Line");
SetIndexLabel(5,"DownTrend Line");
//----
SetIndexDrawBegin(0,Length);
SetIndexDrawBegin(1,Length);
SetIndexDrawBegin(2,Length);
SetIndexDrawBegin(3,Length);
SetIndexDrawBegin(4,Length);
SetIndexDrawBegin(5,Length);
//----
return(0);
}

//+------------------------------------------------------------------+
//| Bollinger Bands_Stop_v1 |
//+------------------------------------------------------------------+
int start()
{
int i,shift,trend;
double smax[25000],smin[25000],bsmax[25000],bsmin[25000];

for (shift=Nbars;shift>=0;shift--)
{
UpTrendBuffer[shift]=0;
DownTrendBuffer[shift]=0;
UpTrendSignal[shift]=0;
DownTrendSignal[shift]=0;
UpTrendLine[shift]=EMPTY_VALUE;
DownTrendLine[shift]=EMPTY_VALUE;
}

for (shift=Nbars-Length-1;shift>=0;shift--)
{
smax[shift]=iBands(NULL,0,Length,Deviation,0,PRICE_CLOSE,MODE _UPPER,shift);
smin[shift]=iBands(NULL,0,Length,Deviation,0,PRICE_CLOSE,MODE _LOWER,shift);

if (High[shift]>smax[shift+1]) trend=1;
if (Low[shift]<smin[shift+1]) trend=-1;

if(trend>0 && smin[shift]<smin[shift+1]) smin[shift]=smin[shift+1];
if(trend<0 && smax[shift]>smax[shift+1]) smax[shift]=smax[shift+1];

bsmax[shift]=smax[shift]+0.5*(MoneyRisk-1)*(smax[shift]-smin[shift]);
bsmin[shift]=smin[shift]-0.5*(MoneyRisk-1)*(smax[shift]-smin[shift]);

if(trend>0 && bsmin[shift]<bsmin[shift+1]) bsmin[shift]=bsmin[shift+1];
if(trend<0 && bsmax[shift]>bsmax[shift+1]) bsmax[shift]=bsmax[shift+1];

if (trend>0)
{
if (Signal>0 && UpTrendBuffer[shift+1]==-1.0)
{
UpTrendSignal[shift]=bsmin[shift];
UpTrendBuffer[shift]=bsmin[shift];
if(Line>0) UpTrendLine[shift]=bsmin[shift];
if (SoundON==true && shift==0 && !TurnedUp)
{
Alert("BBands going Up on ",Symbol(),"-",Period());
TurnedUp = true;
TurnedDown = false;
}
}
else
{
UpTrendBuffer[shift]=bsmin[shift];
if(Line>0) UpTrendLine[shift]=bsmin[shift];
UpTrendSignal[shift]=-1;
}
if (Signal==2) UpTrendBuffer[shift]=0;
DownTrendSignal[shift]=-1;
DownTrendBuffer[shift]=-1.0;
DownTrendLine[shift]=EMPTY_VALUE;
}
if (trend<0)
{
if (Signal>0 && DownTrendBuffer[shift+1]==-1.0)
{
DownTrendSignal[shift]=bsmax[shift];
DownTrendBuffer[shift]=bsmax[shift];
if(Line>0) DownTrendLine[shift]=bsmax[shift];
if (SoundON==true && shift==0 && !TurnedDown)
{
Alert("BBands going Down on ",Symbol(),"-",Period());
TurnedDown = true;
TurnedUp = false;
}
}
else
{
DownTrendBuffer[shift]=bsmax[shift];
if(Line>0)DownTrendLine[shift]=bsmax[shift];
DownTrendSignal[shift]=-1;
}
if (Signal==2) DownTrendBuffer[shift]=0;
UpTrendSignal[shift]=-1;
UpTrendBuffer[shift]=-1.0;
UpTrendLine[shift]=EMPTY_VALUE;
}

}
return(0);
}

Last edited by cyberpasta; 11-30-2007 at 09:07 PM.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #878 (permalink)  
Old 11-30-2007, 11:06 PM
Junior Member
 
Join Date: Mar 2007
Posts: 6
pgtips is on a distinguished road
thanks Ralph, I tried this but then it gave another list of errors - said that all the variables in the includes file are not defined - but they are

I'll have another go at this over the weekend, it's frustrating me a bit at the moment.

@faqcya - I suspect you are right about putting it into a script but I don't know how else to handle calling it unless I have a shell EA to put it into.

Maybe I'll have a look at the templates and see if I can call it from that or even better possibly turn it into an EA, I only want it as it is, not to do anything else.

Thanks for your help,

Kevin


Quote:
Originally Posted by ralph.ronnquist View Post
@pgtips: change the second line to be only
PHP Code:
#define MAGIC 20051120 
i.e., no equal sign and no comma.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #879 (permalink)  
Old 12-09-2007, 09:51 PM
Putz's Avatar
Junior Member
 
Join Date: Aug 2006
Posts: 24
Putz is on a distinguished road
Trying to learn programming

First of all, I have read the entire course by Corder's Guru and found it very interesting. I have come to the conclusion that the only reasonable way to try out a strategy is by writing a program to make sure it is fully accurate. Unfortunately, I am a total newbie when it comes to this.

I have been trying to write a basic program and can't even get that to work. At least I don't get any errors anymore but it doesn't take any orders. I am persistent and will keep trying but would appreciate some help from anybody who sees my mistake

All I am trying to do at this point is to track the lowest price (CurrentLow) and then when it retraces by a certain amount (Ret1), place a sell order with TP of the low point.

Please don't laugh but the following is what I have written so far:


//---- input parameters
extern double TP1=75.0;
extern double Ret1=75.0;
extern double SL1=150.0;
extern double Lots=0.1;

//+------------------------------------------------------------------+
//| expert initialization function |
//+------------------------------------------------------------------+
int init()
{
//----

//----
return(0);
}
//+------------------------------------------------------------------+
//| expert deinitialization function |
//+------------------------------------------------------------------+
int deinit()
{
//----

//----
return(0);
}
//+------------------------------------------------------------------+
//| expert start function |
//+------------------------------------------------------------------+
int start()
{
int ticket=0;
if(Bars<100)
{
Print("bars less than 100");
return(0);
}

double CurrentLow,CurrentHigh;
if(Bid < CurrentLow)
{
CurrentLow = Bid;
if(Bid > CurrentHigh)
{
CurrentHigh = Bid;
if(CurrentHigh >= CurrentLow+(Point*Ret1))
{
ticket=OrderSend(Symbol(),OP_SELL,Lots,Bid,3,Bid+( SL1*Point),Bid-(TP1*Point),"Albatross_v1",757575,0,Green);
return (0);
}
return (0);
}
return(0);
}
}
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #880 (permalink)  
Old 12-09-2007, 10:51 PM
Senior Member
 
Join Date: Feb 2006
Posts: 559
Michel is on a distinguished road
Quote:
Originally Posted by Putz View Post
First of all, I have read the entire course by Corder's Guru and found it very interesting. I have come to the conclusion that the only reasonable way to try out a strategy is by writing a program to make sure it is fully accurate. Unfortunately, I am a total newbie when it comes to this.

I have been trying to write a basic program and can't even get that to work. At least I don't get any errors anymore but it doesn't take any orders. I am persistent and will keep trying but would appreciate some help from anybody who sees my mistake

All I am trying to do at this point is to track the lowest price (CurrentLow) and then when it retraces by a certain amount (Ret1), place a sell order with TP of the low point.

Please don't laugh but the following is what I have written so far:


//---- input parameters
extern double TP1=75.0;
extern double Ret1=75.0;
extern double SL1=150.0;
extern double Lots=0.1;

//+------------------------------------------------------------------+
//| expert initialization function |
//+------------------------------------------------------------------+
int init()
{
//----

//----
return(0);
}
//+------------------------------------------------------------------+
//| expert deinitialization function |
//+------------------------------------------------------------------+
int deinit()
{
//----

//----
return(0);
}
//+------------------------------------------------------------------+
//| expert start function |
//+------------------------------------------------------------------+
int start()
{
int ticket=0;
if(Bars<100)
{
Print("bars less than 100");
return(0);
}

double CurrentLow,CurrentHigh;
if(Bid < CurrentLow)
{
CurrentLow = Bid;
if(Bid > CurrentHigh)
{
CurrentHigh = Bid;
if(CurrentHigh >= CurrentLow+(Point*Ret1))
{
ticket=OrderSend(Symbol(),OP_SELL,Lots,Bid,3,Bid+( SL1*Point),Bid-(TP1*Point),"Albatross_v1",757575,0,Green);
return (0);
}
return (0);
}
return(0);
}
}
It seems wrong to check if Bid > CurrentHigh inside the true condition that Bid < CurrentLow; I thing you should have independent tests like this :
PHP Code:
double CurrentLow,CurrentHigh;
int start()
{     
      if(
Bid CurrentLowCurrentLow Bid;
      if(
Bid CurrentHighCurrentHigh Bid;
      if(
Bid >= CurrentLow+(Point*Ret1))
         
OrderSend(Symbol(),OP_SELL,Lots,Bid,3,Bid+(SL1*Point),Bid-(TP1*Point),"Albatross_v1",757575,0,Green);
      return(
0);

Now, three remarks:
- You have to declare CurrentHigh and CurrentLow on a global scoop, ie out of any function (and start() is a function) otherwize those variables will be initialized to 0 at each call of the function.
- You don't need CurrentHigh as it is not used.
- You have to implement some logic to reset/update the value of CurrentLow, and probably to limit the opening of orders at each tick above CurrentLow+(Point*Ret1))
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply

Bookmarks

Tags
histogram, forex, ZUP_v1.mq4

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off
Forum Jump

LinkBacks (?)
LinkBack to this Thread: http://www.forex-tsd.com/questions/270-ask.html
Posted By For Type Date
OzFx System:) - Page 639 This thread Refback 06-21-2008 10:53 PM
Forex SRDC Sidus Sibkis EA MT4 Forum OTCSmart This thread Refback 12-08-2007 12:46 PM


All times are GMT. The time now is 06:09 AM.



Search Engine Friendly URLs by vBSEO 3.2.0 ©2008, Crawlability, Inc.