| New signals service! | |
|
|||||||
| 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 |
|
![]() |
|
|
LinkBack (2) | Thread Tools | Display Modes |
|
|||
|
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"; 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 |
|
|||
|
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:
![]() Last edited by cyberpasta; 11-30-2007 at 03:24 AM. |
|
|||
|
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:
Last edited by cyberpasta; 11-30-2007 at 09:07 PM. |
|
|||
|
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 |
|
||||
|
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); } } |
|
|||
|
Quote:
PHP Code:
- 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)) |
![]() |
| Bookmarks |
| Tags |
| histogram, forex, ZUP_v1.mq4 |
| Thread Tools | |
| Display Modes | |
|
|
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 | |