MT4 Problem with BUY script
  #1 (permalink)  
Old 03-31-2008, 07:16 PM
Freshman
 
Join Date: Mar 2008
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
ableze_joepardy is on a distinguished road
Default MT4 Problem with BUY script

hi.. I've modified the default script (trade.mq4) in metatrader platform to execute martingle based trade.. the condition is like below:

Starting lot: 0.1
Multiple: 2
Pips: 8
TP: 10
Max trade: 5

and here's the code..

Code:
//+------------------------------------------------------------------+ //| buy 1 lot.mq4 | //| Copyright © 2004, MetaQuotes Software Corp. | //| http://www.metaquotes.net/ | //+------------------------------------------------------------------+ #property copyright "Copyright © 2004, MetaQuotes Software Corp." #property link "http://www.metaquotes.net/" #include <stdlib.mqh> #include <WinUser32.mqh> //+------------------------------------------------------------------+ //| script "trading for all money" | //+------------------------------------------------------------------+ int start() { //---- if(MessageBox("Do you really want to execute Martingle "+Symbol()+" at ASK price? ", "Script",MB_YESNO|MB_ICONQUESTION)!=IDYES) return(1); //---- int ticket1=OrderSend(Symbol(),OP_BUY,0.1,Ask,3,Ask-40*Point,Ask+10*Point,"GU M5",770,0,CLR_NONE); int ticket2=OrderSend(Symbol(),OP_BUYLIMIT,0.2,Ask-8*Point,3,Ask-40*Point,Ask+2*Point,"GU M5",770,0,CLR_NONE); int ticket3=OrderSend(Symbol(),OP_BUYLIMIT,0.4,Ask-16*Point,3,Ask-40*Point,Ask-6*Point,"GU M5",770,0,CLR_NONE); int ticket4=OrderSend(Symbol(),OP_BUYLIMIT,0.8,Ask-24*Point,3,Ask-40*Point,Ask-14*Point,"GU M5",770,0,CLR_NONE); int ticket5=OrderSend(Symbol(),OP_BUYLIMIT,1.6,Ask-32*Point,3,Ask-40*Point,Ask-22*Point,"GU M5",770,0,CLR_NONE); if(ticket1<1) { int error1=GetLastError(); Print("Error = ",ErrorDescription(error1)); return; } if(ticket2<1) { int error2=GetLastError(); Print("Error = ",ErrorDescription(error2)); return; } if(ticket3<1) { int error3=GetLastError(); Print("Error = ",ErrorDescription(error3)); return; } if(ticket4<1) { int error4=GetLastError(); Print("Error = ",ErrorDescription(error4)); return; } if(ticket5<1) { int error5=GetLastError(); Print("Error = ",ErrorDescription(error5)); return; } //---- OrderPrint(); return(0); } //+------------------------------------------------------------------+
but the code didnt execute the order.. whats wrong with the code?
Reply With Quote
ProFX Powerful Trading System
File MQH can not run
  #2 (permalink)  
Old 09-06-2008, 06:23 PM
Freshman
 
Join Date: Sep 2008
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
tvvh220172 is on a distinguished road
Default File MQH can not run

Pls help me, when i click COMPILE it say that " OrderReliable V021.mqh ca not open the progam file. so what do i do with this, Pls help me


/================================================== ===========================
#include <OrderReliable V0.2.1.mqh>
//+---------------------------------------------------+
//|Money Management |
//+---------------------------------------------------+
extern bool MoneyManagement = true; // Change to false if you want to shutdown money management controls.
// Lots = 1 will be in effect and only 1 lot will be open regardless of equity.
extern double TradeSizePercent = 10; // Change to whatever percent of equity you wish to risk.
extern double Lots = 1; // Number of lots to trade when MoneyManagement is false
double MaxLots = 100.0;// Maximum number of lots allowed by broker
//---- input parameters
extern double TakeProfit = 0;
extern double StopLoss = 60;
extern int UseTrailingStop = 0;
extern int TrailingStopType = 2; // Type 1 trails immediately, type 2 waits for move size TrailingStop before trail begins
extern double TrailingStop = 40;
extern string Sep1 = "======= General Inputs =======";
extern int SignalCandle = 1; // 0 opens and closes trades on current unclosed bar, 1 on closed bar
extern int ExitOnCross = 1; // Exit trade when signals say reverse of entry
.....
.....
Reply With Quote
  #3 (permalink)  
Old 09-08-2008, 03:00 AM
Senior
 
Join Date: Feb 2007
Posts: 233
Thanks: 9
Thanked 18 Times in 15 Posts
FerruFx is on a distinguished road
Default

Quote:
Originally Posted by tvvh220172 View Post
Pls help me, when i click COMPILE it say that " OrderReliable V021.mqh ca not open the progam file. so what do i do with this, Pls help me
The "OrderReliable V021.mqh" file must be in your /experts/include/ folder.

FerruFx
__________________
THE HEART of FOREX & THE PROBABILITY METER - Trade with 100% confidence and ... Stress Less!!! More info here
Coding services: Experts Advisors, indicators, alerts, etc ...

NEW: TripleXXX Expert Advisor developed by Spiritfriends and coded by FerruFx ... more info
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


Similar Threads
Thread Thread Starter Forum Replies Last Post
MT4 SCrIPT chart.trader Tutorials, Tips & Tricks 3 04-07-2008 11:54 PM
script needed forex9 Tools / Utilities 6 09-20-2007 02:56 PM
Run Script from an EA waaustin MetaTrader and ZeroCode 0 05-11-2007 06:59 PM
Execute Script/EA Nordic12 System Coding 3 05-03-2007 12:10 AM
I need this simple script :-) bossxero MetaTrader and ZeroCode 2 11-22-2006 01:03 AM


All times are GMT. The time now is 12:29 AM.
Powered by vBulletin Version 3.6.2
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.1.0

Registered members have access to special online forex currency trading tools, software, mt4 expert advisors and indicators. Register now

Main Menu

Economic Forecast