PDA

View Full Version : Help please... aged brain/ cold weather = coding problem



Sokay
03-13-2019 00:43, 12:43 AM
Monitoring 34 pairs.
Values stored in variety
Seeking to count the number of down moves in the open inside a particular bar.
Each time chart symbol is altered the returned numbers change and cannot work out why.
The pattern below is called every tick or on symbol change.

Can you see my mistake please?

Inserted Code void CheckMulti() datetime mBtime = iTime(NULL, mTF, 0); int mCnt = 0, mCntd = 0, mPipF = 1, I = 0; bool mWait = true, mWaitd = true; double mB1Op = 0, mMove = 0; ArrayInitialize(mUD, 0); for(I = 0; I lt; mPairs; I ) MarketInfo(aSymbols#91;I#93;, MODE_DIGITS) == 5) mPipF = 10; mMove = mCndlMove * Point * mPipF; // How many reduced TF candles because greater TF open int mCndls = (int)(iTime(NULL, mCountTime, 0) - iTime(NULL, mTF, 0)) / mCountTime / 60; // Count moves upward for(int n = 0; n lt; mCndls; n ) if(iLow(aSymbolsNumber 91;I#93;, mCountTime, iBarShift(aSymbolsNumber 91;I#93;, mCountTime, mBtime) -n) lt;= mB1Op) mWait = false; should (iHigh(aSymbolsNumber 91;I#93;, mCountTime, iBarShift(aSymbols#91;I#93;, mCountTime, mBtime) -n) gt;= mB1Op mMove! MWait) mCnt ; mWait = true; mUD#91;I#93;#91;0#93; = mCnt; // Count moves down for(int d = 0; d lt; mCndls; d ) if(iHigh(aSymbols#91;I#93;, mCountTime, iBarShift(aSymbols#91;I#93;, mCountTime, mBtime) - d) gt;= mB1Op) mWaitd = false; should (iLow(aSymbolsNumber 91;I#93;, mCountTime, iBarShift(aSymbols#91;I#93;, mCountTime, mBtime) - d) lt;= mB1Op - mMove! MWaitd) mCntd ; mWaitd = true; mUD#91;#93;#91;1#93; = mCntd; // for I return;
TIA

M.