I don't want to take a new trade until signalreset (value 3) shows up.
I think you have it backwards, you don't want a new trade until a buy or sell signal shows up.#define SIGNAL_NONE -1 int Order; // Must be global so it is remembered int init(){ Order = SIGNAL_NONE; ... } int start(){ static datetime Time0; if (Time0 == Time[0]); return(0); Time0 = Time[0]; // Wait for a new bar. : if (signalup!=EMPTY_VALUE&&signalup!=0) { Order = SIGNAL_BUY; } if (signaldown!=EMPTY_VALUE&&signaldown!=0){ Order = SIGNAL_SELL; } if (Order == SIGNAL_NONE) return(0); : int ticket = OrderSend(...); if (ticket < 0) Alert("OrderSend failed: ", GetLastError()); else Order == SIGNAL_NONE; // Wait for new signalBut if you really mean when the indicator posts a reset in buffer 3
int start(){ static bool AllowedToTrade=false; if(!AllowedToTrade){ double signalreset=iCustom(Symbol(),0,"Xochi",3,1); if (signalreset == ..) return(0); // No reset AllowedToTrade = true; // Saw reset } : int ticket = OrderSend(...); if (ticket < 0) Alert("OrderSend failed: ", GetLastError()); else AllowedToTrade = false; // Wait for new signal
Fixed thanks to WHRoeder!
You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register
Hi!
First of all; my EA is coming along great thanks to mq4l.com & FF.com! Thanks for all the help!
However, i'm afraid i'm stuck again.
- I have a signalup & signaldown value;
Now, I want to add a third "reset" signal. Lets call it;
As soon as a trade is triggered I don't want to take a new trade until signalreset (value 3) shows up.
Is this possible? If so, how do I accomplish this?
I hope my explanation is sufficient, i'm not familiar w/ the coding jargon plus i'm not typing in my mother-tongue.
I hope someone can help me out
~WW