Forex
Google

Go Back   Forex Trading > Metatrader Training > Metatrader 4 mql 4 - Development course > Questions
Forex Forum Register FAQ Members List Calendar Search Today's Posts Mark Forums Read


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
  #1071 (permalink)  
Old 05-01-2008, 01:00 PM
newdigital newdigital is online now
Administrator
 
Join Date: Sep 2005
Posts: 15,230
newdigital has much to be proud ofnewdigital has much to be proud ofnewdigital has much to be proud ofnewdigital has much to be proud ofnewdigital has much to be proud ofnewdigital has much to be proud ofnewdigital has much to be proud ofnewdigital has much to be proud of
I replied here Error codes script!
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #1072 (permalink)  
Old 05-01-2008, 08:55 PM
Dave137 Dave137 is offline
Senior Member
 
Join Date: Oct 2007
Posts: 154
Dave137 is on a distinguished road
Question Help with line statement PLEASE

PHP Code:
   if(Period()==PERIOD_M15 && Symbol()=GBPUSDUPLevel=.35
What is lacking in this statement. I am getting an error about the currency symbol GBPUSD. Please assist in fixing my error!

Thanks a bunch in advance!

Dave
<><<<
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #1073 (permalink)  
Old 05-01-2008, 09:18 PM
Michel Michel is offline
Senior Member
 
Join Date: Feb 2006
Posts: 502
Michel is on a distinguished road
Quote:
Originally Posted by Dave137 View Post
PHP Code:
   if(Period()==PERIOD_M15 && Symbol()=GBPUSDUPLevel=.35
What is lacking in this statement. I am getting an error about the currency symbol GBPUSD. Please assist in fixing my error!

Thanks a bunch in advance!

Dave
<><<<
PHP Code:
   if(Period()==PERIOD_M15 && Symbol()=="GBPUSD"UPLevel=0.35
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #1074 (permalink)  
Old 05-01-2008, 09:21 PM
Dave137 Dave137 is offline
Senior Member
 
Join Date: Oct 2007
Posts: 154
Dave137 is on a distinguished road
Smile

Thank You So Much!!

Dave
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #1075 (permalink)  
Old 05-02-2008, 03:01 PM
Dave137 Dave137 is offline
Senior Member
 
Join Date: Oct 2007
Posts: 154
Dave137 is on a distinguished road
Red face Triple Trailing Stop Problem - Please Help In Coding!

PHP Code:
void TrailingPositions() {
  
double pBidpAskpp;

  
pp MarketInfo(OrderSymbol(), MODE_POINT);
  if (
OrderType()==OP_BUY) {
   
pBid MarketInfo(OrderSymbol(), MODE_BID);

//BreakEven routine
    
if (BreakEven>0) {
      if ((
pBid-OrderOpenPrice())>BreakEven*pp) {
         if ((
OrderStopLoss()-OrderOpenPrice())<0) {
            
ModifyStopLoss(OrderOpenPrice()+0*pp);
         }   
      }    
    }
    
    if (
TrailingStop>0) { 
    
    if ((
pBid-OrderOpenPrice())>TrailingStop_Over135*pp){ //15 pips TS
    
    
ModifyStopLoss(pBid-TrailingStop_Over135*pp);
    
    if (
pBid-OrderOpenPrice()>TrailingStop_Over90*pp && pBid-OrderOpenPrice()<TrailingStop_Over135*pp){ //55 pips TS
    
    
ModifyStopLoss(pBid-TrailingStop_Over90*pp);

    if ((
OrderOpenPrice()-pAsk)>TrailingStop +TrailingStep+1*pp && (OrderOpenPrice()-pAsk) < TrailingStop_Over90*pp+TrailingStep-1*pp || OrderStopLoss()==0) {//75 pips TS
      
    
ModifyStopLoss(pAsk+TrailingStop*pp);
    
    
 
        return;
      }
     }
    }
   }
  } 
Three levels of Trailing Stop:
1) 75 Pips TS up to first 90 Pips Profit.
2) 55 Pips TS after 90 but only up to 135 pips profit.
3) 15 Pips TS after 135 pips profit.

The problem I am having is the Trailing Stop moves both up and down as the price moves up and down . . It should just be moving up as the price profit increases and stop if the price starts dropping! How do I get it to stop moving down as the price drops - The Trailing Stop is acting like a Yo-Yo as the price moves up and down.

I am not sure how to stop this from happening?? Please, I need your expertise!

Humbly,

Dave

Last edited by Dave137 : 05-02-2008 at 04:47 PM.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #1076 (permalink)  
Old 05-02-2008, 04:44 PM
n3sve1k4s n3sve1k4s is offline
Junior Member
 
Join Date: Aug 2007
Posts: 18
n3sve1k4s is on a distinguished road
Hi codersguru

could you add signal with pop-up and arrows to indicator below?
Attached Files
File Type: mq4 HL Next Activator.mq4 (7.6 KB, 6 views)
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #1077 (permalink)  
Old 05-02-2008, 07:46 PM
Michel Michel is offline
Senior Member
 
Join Date: Feb 2006
Posts: 502
Michel is on a distinguished road
Quote:
Originally Posted by Dave137 View Post
PHP Code:
void TrailingPositions() {
  
double pBidpAskpp;

  
pp MarketInfo(OrderSymbol(), MODE_POINT);
  if (
OrderType()==OP_BUY) {
   
pBid MarketInfo(OrderSymbol(), MODE_BID);

//BreakEven routine
    
if (BreakEven>0) {
      if ((
pBid-OrderOpenPrice())>BreakEven*pp) {
         if ((
OrderStopLoss()-OrderOpenPrice())<0) {
            
ModifyStopLoss(OrderOpenPrice()+0*pp);
         }   
      }    
    }
    
    if (
TrailingStop>0) { 
    
    if ((
pBid-OrderOpenPrice())>TrailingStop_Over135*pp){ //15 pips TS
    
    
ModifyStopLoss(pBid-TrailingStop_Over135*pp);
    
    if (
pBid-OrderOpenPrice()>TrailingStop_Over90*pp && pBid-OrderOpenPrice()<TrailingStop_Over135*pp){ //55 pips TS
    
    
ModifyStopLoss(pBid-TrailingStop_Over90*pp);

    if ((
OrderOpenPrice()-pAsk)>TrailingStop +TrailingStep+1*pp && (OrderOpenPrice()-pAsk) < TrailingStop_Over90*pp+TrailingStep-1*pp || OrderStopLoss()==0) {//75 pips TS
      
    
ModifyStopLoss(pAsk+TrailingStop*pp);
    
    
 
        return;
      }
     }
    }
   }
  } 
Three levels of Trailing Stop:
1) 75 Pips TS up to first 90 Pips Profit.
2) 55 Pips TS after 90 but only up to 135 pips profit.
3) 15 Pips TS after 135 pips profit.

The problem I am having is the Trailing Stop moves both up and down as the price moves up and down . . It should just be moving up as the price profit increases and stop if the price starts dropping! How do I get it to stop moving down as the price drops - The Trailing Stop is acting like a Yo-Yo as the price moves up and down.

I am not sure how to stop this from happening?? Please, I need your expertise!

Humbly,

Dave
for example:
PHP Code:
ts pBid TrailingStop_Over135*pp;
if (
ts OrderOpenPrice() && ts OrderStopLoss()) ModifyStopLoss(ts); 
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #1078 (permalink)  
Old 05-03-2008, 05:51 AM
solamax's Avatar
solamax solamax is offline
Junior Member
 
Join Date: Apr 2008
Posts: 12
solamax is on a distinguished road
please may i ask for help




Can I ask anybody to have a look at my code to see where it's wrong please....I am not much of a programmer and would appreciate some assistance with this.


many thanks in advance

also i just realized something - theres a guy called Ben Taylor selling an EA that looks almost exactly like the one that coder's guru programmed - maybe thats one of his clients - lol

if its not - we should let coders guru know about this
Attached Files
File Type: mq4 the 550 trader.mq4 (10.0 KB, 12 views)
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #1079 (permalink)  
Old 05-03-2008, 07:45 AM
yyc196's Avatar
yyc196 yyc196 is offline
Senior Member
 
Join Date: Dec 2006
Location: Earth
Posts: 198
yyc196 is on a distinguished road
Quote:
Originally Posted by Michel View Post
If needed, check first that you are later than 8 am:
PHP Code:
if(Hour() < 8) return; 
Then, find the max and min of the current day. (if its ok for you, its easier than from 8 am):
PHP Code:
double Max iHigh(Symbol(), PERIOD_D10);
double Min iLow(Symbol(), PERIOD_D10);
int Range = (Max Min) / Point;
if(
Range 90) return;
... 
Hi Michel:


I refer to your code:

if(Hour() < 8) return;

I modified the code as follow:

if(Hour()>12) hr_x=1;
.....
.....
.....
.....
if(hr_x==1) signal=50;

But I had all the histogram bar 50!!!!

If you look at the chart below, it seem that the "Hour" command does not recognise it!!!
FYI, I am using 30 min chart, will there be a different. I tried to switch to 1Hour chart but the problem still exist!
I also tried "if(Hour() < 8) return; " but all the bar gone!!!
I tried many things but still cannot get it works.

Possible to advise me again? Thanks
Attached Images
File Type: jpg untitled.JPG (114.4 KB, 82 views)

Last edited by yyc196 : 05-03-2008 at 09:59 AM.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #1080 (permalink)  
Old 05-03-2008, 12:53 PM
n3sve1k4s n3sve1k4s is offline
Junior Member
 
Join Date: Aug 2007
Posts: 18
n3sve1k4s is on a distinguished road
Quote:
Originally Posted by n3sve1k4s View Post
Hi codersguru

could you add signal with pop-up and arrows to indicator below?
can anyone add a signal???
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
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 09:53 PM
Forex SRDC Sidus Sibkis EA MT4 Forum OTCSmart This thread Refback 12-08-2007 11:46 AM


All times are GMT. The time now is 12:27 PM.