|
|||||||
| 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 |
|
|||
|
Quote:
You have other issues with this EA. You are stating that you would like to make a buy or sell when VAR1, VAR2 or VAR3 has reached or exceeded certain values. You must first define what is VAR1, 2 and 3? Some indicator with specific settings? Thanks, StrangeGuy |
|
|||
|
Take Profit, cancel all other orders
Does anyone know how to code once the open order hit profit target, the rest of the pending orders will be deleted? It is different from oco. I have checked the elite section, but nothing there.
|
|
|||
|
question
I do not understand the difference of two programs, but would teach it?
int limit = Bars-IndicatorCounted(); int i ; for( i=limit-1; i>=0; i--) int counted_bars=IndicatorCounted(); //---- check for possible errors if(counted_bars<0) return(-1); //---- last counted bar will be recounted if(counted_bars>0) counted_bars--; limit=Bars-counted_bars; for(i = 0; i <= limit; i++) |
|
|||
|
Quote:
The first one scan the bars following the natural time, ie from the oldest to the newest bar. The second one scan the bars in the opposite direction: it can work if the calcul of a bar doesn't involve the result of the previous bar; In general it's better to use the same direction as the time: it always works and there are no possibilties of mistaken. |
|
|||
|
Other question
now my EA like this
if(FastMA2 <= SlowMA2 && FastMA1 > SlowMA1) { ClosePositions(); OrderSend(Symbol(),OP_BUY,Lots,Ask,Slippage,Ask-SLpips*Point,Ask+(45*Point),"",MAGIC,0,Blue); return(0); i want to change like this 1. 15minutus timeflame happen buy sign 2. if then 5minutes timeflame MA cross buy sign already ,too ClosePosition. and get new position if then 5minutes timeflame MA change sell sign already wait 5minutes timeflame change buy sign , then ClosePosition. and get new position Please tell me how to write this program. |
|
||||
|
Need help with coding ease of movement indicator
I tried to code it myself but the indicator line doesn't show in the indicator window when I run it. If you go here MANUAL - TECHNICAL INDICATORS it has a definition of the indicator with the formula for calculating it.
Here's the code I have written: //+------------------------------------------------------------------+ //| Ease of Movement.mq4 | //| Copyright © 2007, MetaQuotes Software Corp. | //| Forex Trading Software: Forex Trading Platform MetaTrader 4 | //+------------------------------------------------------------------+ #property copyright "Copyright © 2007, MetaQuotes Software Corp." #property link "http://www.metaquotes.net" #property indicator_separate_window #property indicator_minimum -50 #property indicator_maximum 50 #property indicator_buffers 1 #property indicator_color1 Yellow //---- buffers double ExtMapBuffer1[]; //+------------------------------------------------------------------+ //| Custom indicator initialization function | //+------------------------------------------------------------------+ int init() { //---- indicators SetIndexStyle(0,DRAW_LINE); SetIndexBuffer(0,ExtMapBuffer1); string short_name = "Ease of Movement"; IndicatorShortName(short_name); //---- return(0); } //+------------------------------------------------------------------+ //| Custom indicator deinitialization function | //+------------------------------------------------------------------+ int deinit() { //---- //---- return(0); } //+------------------------------------------------------------------+ //| Custom indicator iteration function | //+------------------------------------------------------------------+ int start() { int counted_bars=IndicatorCounted(); //----check for errors if (counted_bars<0) return(-1); //----last counted bar will be recounted if (counted_bars>0) counted_bars--; int k = Bars - counted_bars; double midptT, midptY, boxR, midptM, EMV; while (k>0) { midptT = (High[k] + Low[k])/2; midptY = (High[k+1] + Low[k+1])/2; midptM = midptT - midptY; boxR = Volume[k]/(High[k] - Low[k]); EMV = midptM / boxR; ExtMapBuffer1[k] = EMV; k--; } return(0); } //+------------------------------------------------------------------+ can anyone tell me what I'm doing wrong? I attached the indicator too if you want to try to run it for yourself.
__________________
"Duct tape is like the force: it has a dark side and a light side, and it holds the universe together." |
|
||||
|
Quote:
Something like this: if ( long2 == true) { Ordersend(); { Print(" long2 signal taken "); } } Hope that helps. ![]() |
![]() |
| 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 |