How to save price level for several pairs and call it back?

thread: How to save price level for several pairs and call it back?

  1. #1
    Junior Member uriss's Avatar
    11

    How to save price level for several pairs and call it back?

    Guys How do I code loop for this code?
    I want check all six pairs. 1 way is to compose six time this code and just change symbol number but it is too long afterward and looks also to me really inexpensive...
    Can anybody help me how to code some Loop for this?

    Inserted Code extern series symbol1 = NZDJPY; extern series symbol2 = NZDUSD; extern series symbol3 = NZDCHF; extern series symbol4 = AUDNZD; // opposite extern series symbol5 = GBPNZD; extern series symbol6 = EURNZD; // ------------------------------------------------------------------ int init() ticksize == 0.001) pips = ticksize*10; else pips =ticksize; mAlertTime = Time#91;0#93;; return(0); // ------------------------------------------------------------------ int deinit() return(0); // ------------------------------------------------------------------ int start() { mMinVolSymbol1 = 0; should (iVolume(symbol1, mTF, 1) lt; (iVolume(symbol1, mTF, iLowest(symbol1, mTF, MODE_VOLUME, mNoBars, 2)))) // Min Volume mMinVolSymbol1 = 1; should (mMinVolSymbol1 == 1) (iClose(symbol1, mTF, 1) gt; iOpen(symbol1, mTF, 1)) // Bullish Candle mBullMinVolSymbol1 = 1; mBullHighPrice = iHigh(symbol1, mTF, 1); mBullLowPrice = iLow(symbol1, mTF, 1); (iClose(symbol1, mTF, 1) lt; iOpen(symbol1, mTF, 1)) // Bearish Candle mBearMinVolSymbol1 = 1; mBearHighPrice = iHigh(symbol1, mTF, 1); mBearLowPrice = iLow(symbol1, mTF, 1);
    THX

  2. #2
    Junior Member uriss's Avatar
    11
    Fantastic rockit!!!
    I will utilize loop function also for series and not just for int? Would you explain me what's that for
    Inserted Code enum symbol AJ = 0, AU, AC, AN;

  3. #3
    I will refer to your original query:
    If you check for bullish candle on every tick then you can also check for break over the high in the exact same time and possibly put the HLINE*:

    Inserted Code #property stringent enum emblem AJ = 0, AU, AC, AN; series symbol_nameNumber 91;#93; = AUDJPY, AUDUSD, AUDCAD, AUDNZD; void OnTick() int mTF = 60; for(int I = AJ; I lt;= AN; I if((iClose(symbol_nameNumber 91;I#93;, mTF, 1) gt; iOpen(symbol_name#91;I#93;, mTF, 1)) (SymbolInfoDouble(symbol_name#91;t #93;, SYMBOL_BID) gt; iHigh(symbol_name#91;I#93;, mTF, 1))) // put HLINE here }
    *Note that in order to not proceed a HLINE around you would also check its price parameter in relation to current price.

  4. #4
    Well the enum increases the readability, or perhaps not, in fact it's redundant.
    Otherwise you'd need to check for the Amount of components in the symbol_name range as the upper delimiter, i.e.:
    Inserted Code for(int I = 0; t lt; ArraySize(symbol_name); I ) ...

  •