Thank you Michel. Using what you've suggested A *= + A does indeed give a positive sign ie: changes -A to +A.
Here;s what I am doing ...
if(Alarm_Reset && (stepSignalBuffer[shift] Upr_level ))
if(stepSignalBuffer[shift] < Lwr_level)
Alarm_Reset = false;
Alarm_Reset = true;
That is,ifthe alarm has been reset (to true) and either signalbuffer < lwr_level orsignalbuffer > upr_level
Play one sound if the signalbuffer is below the lower level or another sound if above the upper level. Set the alarm to false (don't want another alarm going off if it's already the done.
Reset the alarm (ie: signalbuffer is outside of the lower_level and the upper_level)
Unfortunately that's not what's happening but at least I know that the code is correct and it's probably down to the logic.
Thank you again Michel.
EDIT: I've just commented stepSignalBuffer[shift] and it's value is always ZERO! I feel such an idiot.
No, this is wrong, I said: A *= -1; not A *= +A;
This flipflop the sign; but if you need to have a positive number, use the MathAbs() function : A = MathAbs(A); Wathever is A , it will become positif.
Weekend test code
Are there any server can feed price to give us chance test our code at Saturday and Sunday ?
I mean if there possible to make simulator server to give chance to test at weekend ?
This idea come because of :
1. While at workdays, we are seriously to watch our chart,
at that time, can't seriously type code.
2. We have more time at weekend, then we can seriously test our code atm.
Maybe some one can give me information about this idea ?
I was after trying t flipflip the sign which appeared to work. I tired the MathsAbs() function too and indeed the number is positive.
Thank you Michel, you have been a great help to me.
//---- check for possible errors
//---- the last counted bar will be recounted
//---- main loop
for(int i=0; i<limit; i++)
//---- ma_shift set to 0 because SetIndexShift called abowe
I try to go thorugh some MQL4 functions and bumped into this sample code as above. Could someone kindly explain:
1.)what's the reason of using "limit" variable there?
2.)I tried to run the sample code, which always returns value 2, what's the purpose of the "limit" value 2 in the for loop,
3.)which position bars does this for loop working on?
search a simple ea
hi ... i search this simple ea
daily breakout EA with trailing stop and profit lock function.
#property indicator question
What is the statement to code #property indicator as a line versus a dash (default)??
Simple question, but unknown answer at present!
Appreciate you answering this for me!
icustom ! indicator -> ea
good morning, is a beginner of the language mq4, I would appreciate a help, I in advance thank!
the indicator has two variables:
bool TurnedUp = false
bool TurnedDown = false
how to use the function icustom in the EA, to read the values of TurnedUp and TurnedDown?
.....my probations, not working, possible because it deals with "bool" ??
part EA and error ..
//| EXPERT BASIC CALCULATION |
//| START HERE |
//EnterLong = TurnedUp;
// EnterShort = TurnedDown;
// EnterLong = true;
// if( TurnedUp == true ) EnterLong== true;
//if(icustom(Symbol(), "postfin","TurnedUp",0,0) == True && EnterLong== 1 )
//| END HERE |
//| YOU SHOULD NOT HAVE TO MODIFY ANYTHING BELOW THIS BOX |
// ENTER LONG CONDITION
if(EnterLong == true && CountLongs(MagicNumber)== 0)
Anybody know how to do this?
Here is what I'm trying to code:
I have a chart with an RSI attached to it. Then I drag and drop a MA into the RSI window and choose apply to "previous indicator's data". Now my moving average is using the RSI values for it's calculations.
I can't figure out how to code this into an EA. The Applied_Price values in mq4 don't have the option to choose "previous indicator's data" for the moving average.
Basically trying to get the current moving average of the current RSI.
If you know what I'm trying to do and may have a solution I would greatly appreciate any help.