| 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 | Thread Tools | Display Modes |
|
||||
|
Problem Statement
start() Disadvantage of a looped Expert Advisor is the impossibility to open the setup panel. Try to loop an EA - and you won't be able to set it up.
The same idea can be successfully realized using a script. This means an infinite loop can be organized in a script. But there are no parameters to be set up in scripts. MagicNumber extern int Expert_ID = 1234; int _MagicNumber = 0; int init() { int Period_ID = 0; switch ( Period() ) { case PERIOD_MN1: Period_ID = 9; break; case PERIOD_W1: Period_ID = 8; break; case PERIOD_D1: Period_ID = 7; break; case PERIOD_H4: Period_ID = 6; break; case PERIOD_H1: Period_ID = 5; break; case PERIOD_M30: Period_ID = 4; break; case PERIOD_M15: Period_ID = 3; break; case PERIOD_M5: Period_ID = 2; break; case PERIOD_M1: Period_ID = 1; break; } _MagicNumber = Expert_ID * 10 + Period_ID; But how about in the same time frame?????? |
|
|||
|
Help code this Great EA
It's Great and it's good, need help coding this EA sumtin like this, can anyone please help me, would really appreciate it please......Indicators Gann_hilo_activator 4HR-------for confirmation of overall trend Gann_hilo_activator 1HR-------for signal 5 simple moving averages (SMA)—for determining the point of entry Entry signals Buy signal (1) If the price opens above the Gann_hilo_activator 1HR and the Gann_hilo_activator 4HR confirms the trend, then buy if the value of 5 SMA is greater than or equal (≥) to the price. Buy signal (2) If the Buy signal (1) condition still holds and the price retraces by a predetermined number of pips then buy another lot e.g. for EUR/USD =32pips. Sell signal (1) If the price opens below the Gann_hilo_activator 1HR and the Gann_hilo_activator 4HR confirms the trend, then sell if the value of 5 SMA is less than or equal (≤) to the price. Sell signal (2) If the Sell signal (1) condition still holds and the price retraces by a predetermined number of pips then sell another lot e.g. for USD/CAD=46pips. Exit signals Close Buy signals If the price opens below the Gann_hilo_activator 1HR Close sell signals If the price opens above the Gann_hilo_activator 1HR External parameters By default -------------------------- Trailing stops = Stop loss = Take profit = extern double Lots = 0.01; // I trade a microlots using a mini account extern int Slippage = 3; extern bool StopLossMode = True; extern int StopLoss = 17; // extern bool TakeProfitMode = false; extern int TakeProfit = 60; extern bool TrailingStopMode = True; extern int TrailingStop = 37; Money management code not risking more than 1.2% on one pair of currency at a time and maximum amount of capital at risk is 10% Gann_hilo_activator 4HR-------for confirmation of overall trend Gann_hilo_activator 1HR-------for signal 5 simple moving averages (SMA)—for determining the point of entry my_EA_@_my_own_risk Hello sir, this is my system that I use and will like to turn in into an EA Indicators Gann_hilo_activator 4HR-------for confirmation of overall trend Gann_hilo_activator 1HR-------for signal 5 simple moving averages (SMA)—for determining the point of entry Entry signals Buy signal (1) If the price opens above the Gann_hilo_activator 1HR and the Gann_hilo_activator 4HR confirms the trend, then buy if the value of 5 SMA is greater than or equal (≥) to the price. Buy signal (2) If the Buy signal (1) condition still holds and the price retraces by a predetermined number of pips then buy another lot e.g. for EUR/USD =32pips. Sell signal (1) If the price opens below the Gann_hilo_activator 1HR and the Gann_hilo_activator 4HR confirms the trend, then sell if the value of 5 SMA is less than or equal (≤) to the price. Sell signal (2) If the Sell signal (1) condition still holds and the price retraces by a predetermined number of pips then sell another lot e.g. for USD/CAD=46pips. Exit signals Close Buy signals If the price opens below the Gann_hilo_activator 1HR Close sell signals If the price opens above the Gann_hilo_activator 1HR External parameters By default -------------------------- Trailing stops = 17 Stop loss = 37 Take profit = false extern double Lots = 0.01; // I trade a microlots using a mini account extern int Slippage = 3; extern bool StopLossMode = True; extern int StopLoss = 17; // extern bool TakeProfitMode = false; extern int TakeProfit = 60; extern bool TrailingStopMode = True; extern int TrailingStop = 37; Money management code not risking more than 1.2% on one pair of currency at a time and maximum amount of capital at risk is 10% Last edited by miquest; 11-23-2007 at 03:09 PM. Reason: correct sumtin |
|
||||
|
Quote:
You could then use Orderselect() to get the info of that specific ticket, when your criteria is met, close your order by magic number. Hope this helps. ![]() |
|
||||
|
Gidday I am slowly fixing the errors in some if my ea's ( and learning alot on the way) but what does this mean.
2007.10.24 21:22:24 1998.11.20 06:00 The Abyss GBPJPY,Daily: invalid double number as parameter 6 for OrderSend function I can't find anything on that error what should I be looking at. |
|
|||
|
Recover a data type from an indicator
Hi
Is it possible to recover a data type from an indicator (3 MA Cross w alert) to put it in a EA? This is what I want to do : In the indicator (3 MA Cross w alert) I put a data type : double execute_trade = "ok_buy" or execute_trade = "ok_sell" here : ************Indicator ************ if ((fasterMAnow > slowerMAnow && fasterMAprevious <= slowerMAprevious && fasterMAafter > slowerMAafter && mediumMAnow > slowerMAnow ) || (fasterMAnow > slowerMAnow && mediumMAnow > slowerMAnow && mediumMAprevious <= slowerMAprevious && mediumMAafter > slowerMAafter )) { CrossUp[i] = Low[i] - Range*0.5; string execute_trade = "ok_buy"; } if ((fasterMAnow < slowerMAnow && fasterMAprevious >= slowerMAprevious && fasterMAafter < slowerMAafter && mediumMAnow < slowerMAnow ) || (fasterMAnow < slowerMAnow && mediumMAnow < slowerMAnow && mediumMAprevious >= slowerMAprevious && mediumMAafter < slowerMAafter )) { CrossDown[i] = High[i] + Range*0.5; execute_trade = "ok_sell"; } ************************ and I'd like to recover "excute_trade" in my EA like this : ***********EA*************** if (excute_trade== "ok_buy") Order = SIGNAL_BUY; if (excute_trade== "ok_sell") Order = SIGNAL_SELL; **************************** But I don't know how to do help please Best regards |
|
|||
|
Quote:
PHP Code:
|
|
|||
|
Quote:
Quote:
I your case the syntax should be : PHP Code:
|
![]() |
| Bookmarks |
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| How to code this? | iscuba11 | Metatrader 4 mql 4 - Development course | 1 | 08-03-2007 04:22 PM |