Export BID and ASK prices, small error in code.

 

hi


i have this indicator to export MA and ATR, but after adding BID and ASK price it stops working. copied it from code base. what am i missing?


thank you very much!



//+------------------------------------------------------------------+
//+------------------------------------------------------------------+

int start()
  {
 static int  flag;
 int handle;
  
   
  double AUDCAD_Bid, AUDCAD_Ask, 
         AUDCAD_M1_50_MA, AUDCAD_M1_300_MA, AUDCAD_M1_500_MA, 
         AUDCAD_M5_50_MA, AUDCAD_M5_300_MA, AUDCAD_M5_500_MA, 
         AUDCAD_M15_50_MA, AUDCAD_M15_300_MA, AUDCAD_M15_500_MA, 
         AUDCAD_M30_50_MA, AUDCAD_M30_300_MA, AUDCAD_M30_500_MA,
         AUDCAD_H1_50_MA, AUDCAD_H1_300_MA, AUDCAD_H1_500_MA,
         AUDCAD_H4_50_MA, AUDCAD_H4_300_MA, AUDCAD_H4_500_MA,
         AUDCAD_D1_50_MA, AUDCAD_D1_300_MA, AUDCAD_D1_500_MA,
         
         AUDCAD_H4_ATR;
  
    
  
         AUDCAD_Bid = MarketInfo(„AUDCAD“,MODE_BID,1);
         AUDCAD_Ask = MarketInfo(„AUDCAD“,MODE_ASK,1);
         AUDCAD_M1_50_MA = iMA("AUDCAD",PERIOD_M1,50,0,MODE_SMA,PRICE_CLOSE,1);
         AUDCAD_M1_300_MA = iMA("AUDCAD",PERIOD_M1,300,0,MODE_SMA,PRICE_CLOSE,1);
         AUDCAD_M1_500_MA = iMA("AUDCAD",PERIOD_M1,500,0,MODE_SMA,PRICE_CLOSE,1);         
         AUDCAD_M5_50_MA = iMA("AUDCAD",PERIOD_M5,50,0,MODE_SMA,PRICE_CLOSE,1);
         AUDCAD_M5_300_MA = iMA("AUDCAD",PERIOD_M5,300,0,MODE_SMA,PRICE_CLOSE,1);
         AUDCAD_M5_500_MA = iMA("AUDCAD",PERIOD_M5,500,0,MODE_SMA,PRICE_CLOSE,1);
         AUDCAD_M15_50_MA = iMA("AUDCAD",PERIOD_M15,50,0,MODE_SMA,PRICE_CLOSE,1);
         AUDCAD_M15_300_MA = iMA("AUDCAD",PERIOD_M15,300,0,MODE_SMA,PRICE_CLOSE,1);
         AUDCAD_M15_500_MA = iMA("AUDCAD",PERIOD_M15,500,0,MODE_SMA,PRICE_CLOSE,1);
         AUDCAD_M30_50_MA = iMA("AUDCAD",PERIOD_M30,50,0,MODE_SMA,PRICE_CLOSE,1);
         AUDCAD_M30_300_MA = iMA("AUDCAD",PERIOD_M30,300,0,MODE_SMA,PRICE_CLOSE,1);
         AUDCAD_M30_500_MA = iMA("AUDCAD",PERIOD_M30,500,0,MODE_SMA,PRICE_CLOSE,1);
         AUDCAD_H1_50_MA = iMA("AUDCAD",PERIOD_H1,50,0,MODE_SMA,PRICE_CLOSE,1);
         AUDCAD_H1_300_MA = iMA("AUDCAD",PERIOD_H1,300,0,MODE_SMA,PRICE_CLOSE,1);
         AUDCAD_H1_500_MA = iMA("AUDCAD",PERIOD_H1,500,0,MODE_SMA,PRICE_CLOSE,1);
         AUDCAD_H4_50_MA = iMA("AUDCAD",PERIOD_H4,50,0,MODE_SMA,PRICE_CLOSE,1);
         AUDCAD_H4_300_MA = iMA("AUDCAD",PERIOD_H4,300,0,MODE_SMA,PRICE_CLOSE,1);
         AUDCAD_H4_500_MA = iMA("AUDCAD",PERIOD_H4,500,0,MODE_SMA,PRICE_CLOSE,1);
         AUDCAD_D1_50_MA = iMA("AUDCAD",PERIOD_D1,50,0,MODE_SMA,PRICE_CLOSE,1);
         AUDCAD_D1_300_MA = iMA("AUDCAD",PERIOD_D1,300,0,MODE_SMA,PRICE_CLOSE,1);
         AUDCAD_D1_500_MA = iMA("AUDCAD",PERIOD_D1,500,0,MODE_SMA,PRICE_CLOSE,1);
          
         
         
         AUDCAD_H4_ATR= iATR("AUDCAD",PERIOD_H4,24, 1);   
         
         

         
//===========================================================    
//===========================================================                           
   handle=FileOpen("MA ATR 50 300 500 600.csv", FILE_CSV|FILE_WRITE, ',');
   if(handle>0)
    {
     FileWrite(handle, 
      DoubleToStr(AUDCAD_Bid, 5), DoubleToStr(AUDCAD_Ask, 5), 
      DoubleToStr(AUDCAD_M1_50_MA,5), DoubleToStr(AUDCAD_M1_300_MA,5), DoubleToStr(AUDCAD_M1_500_MA,5), 
      DoubleToStr(AUDCAD_M5_50_MA,5), DoubleToStr(AUDCAD_M5_300_MA,5), DoubleToStr(AUDCAD_M5_500_MA,5), 
      DoubleToStr(AUDCAD_M15_50_MA,5), DoubleToStr(AUDCAD_M15_300_MA,5), DoubleToStr(AUDCAD_M15_500_MA,5), 
      DoubleToStr(AUDCAD_M30_50_MA,5), DoubleToStr(AUDCAD_M30_300_MA,5), DoubleToStr(AUDCAD_M30_500_MA,5),
      DoubleToStr(AUDCAD_H1_50_MA,5), DoubleToStr(AUDCAD_H1_300_MA,5), DoubleToStr(AUDCAD_H1_500_MA,5),
      DoubleToStr(AUDCAD_H4_50_MA,5), DoubleToStr(AUDCAD_H4_300_MA,5), DoubleToStr(AUDCAD_H4_500_MA,5),
      DoubleToStr(AUDCAD_D1_50_MA,5), DoubleToStr(AUDCAD_D1_300_MA,5), DoubleToStr(AUDCAD_D1_500_MA,5),
         
      DoubleToStr(AUDCAD_H4_ATR, 5)

     );

     FileClose(handle);
     Comment(" MA_ATR 50 300 500 600 SENT ");
    }

    return(0);
  }
 
bosslife:

i have this indicator to export MA and ATR, but after adding BID and ASK price it stops working. copied it from code base. what am i missing?

Don't you think something is wrong?

AUDCAD_Bid = MarketInfo(„AUDCAD“,MODE_BID,1);
AUDCAD_Ask = MarketInfo(„AUDCAD“,MODE_ASK,1);
 
Naguisa Unada:

Don't you think something is wrong?

the ", 1"? i don't know what it stands for.

 
bosslife:

the ", 1"? i don't know what it stands for.

Yes, that's right and also „ before symbols.

 
Naguisa Unada:

Don't you think something is wrong?

I don't know what you are doing with your text color but it is almost unreadable. Please don't do that.
 
Naguisa Unada:

Yes, that's right and also „ before symbols.

you mean like this?

AUDCAD_Bid = MarketInfo(AUDCAD,MODE_BID);
AUDCAD_Ask = MarketInfo(AUDCAD,MODE_ASK);

doesnt work tho :/

 
bosslife:

you mean like this?

AUDCAD_Bid = MarketInfo("AUDCAD“,MODE_BID);
AUDCAD_Ask = MarketInfo("AUDCAD“,MODE_ASK);
 
Alain Verleyen:
I don't know what you are doing with your text color but it is almost unreadable. Please don't do that.

What do you mean?
It is displayed normally on my screen.

 
Naguisa Unada:

What do you mean?
It is displayed normally on my screen.

See :


I have this issue only with your posts, nobody else, so must be something on your side.

 
Naguisa Unada:

when i try to run the indicator it doesnt open. or what did you mean with " ?

//+------------------------------------------------------------------+
//+------------------------------------------------------------------+

int start()
  {
 static int  flag;
 int handle;
  
   
  double AUDCAD_Bid, AUDCAD_Ask, 
         AUDCAD_M1_50_MA, AUDCAD_M1_300_MA, AUDCAD_M1_500_MA, 
         AUDCAD_M5_50_MA, AUDCAD_M5_300_MA, AUDCAD_M5_500_MA, 
         AUDCAD_M15_50_MA, AUDCAD_M15_300_MA, AUDCAD_M15_500_MA, 
         AUDCAD_M30_50_MA, AUDCAD_M30_300_MA, AUDCAD_M30_500_MA,
         AUDCAD_H1_50_MA, AUDCAD_H1_300_MA, AUDCAD_H1_500_MA,
         AUDCAD_H4_50_MA, AUDCAD_H4_300_MA, AUDCAD_H4_500_MA,
         AUDCAD_D1_50_MA, AUDCAD_D1_300_MA, AUDCAD_D1_500_MA,
         
         AUDCAD_H4_ATR;
  
    
  
         AUDCAD_Bid = MarketInfo(“AUDCAD”,MODE_BID);
         AUDCAD_Ask = MarketInfo(“AUDCAD”,MODE_ASK);
         AUDCAD_M1_50_MA = iMA("AUDCAD",PERIOD_M1,50,0,MODE_SMA,PRICE_CLOSE,1);
         AUDCAD_M1_300_MA = iMA("AUDCAD",PERIOD_M1,300,0,MODE_SMA,PRICE_CLOSE,1);
         AUDCAD_M1_500_MA = iMA("AUDCAD",PERIOD_M1,500,0,MODE_SMA,PRICE_CLOSE,1);         
         AUDCAD_M5_50_MA = iMA("AUDCAD",PERIOD_M5,50,0,MODE_SMA,PRICE_CLOSE,1);
         AUDCAD_M5_300_MA = iMA("AUDCAD",PERIOD_M5,300,0,MODE_SMA,PRICE_CLOSE,1);
         AUDCAD_M5_500_MA = iMA("AUDCAD",PERIOD_M5,500,0,MODE_SMA,PRICE_CLOSE,1);
         AUDCAD_M15_50_MA = iMA("AUDCAD",PERIOD_M15,50,0,MODE_SMA,PRICE_CLOSE,1);
         AUDCAD_M15_300_MA = iMA("AUDCAD",PERIOD_M15,300,0,MODE_SMA,PRICE_CLOSE,1);
         AUDCAD_M15_500_MA = iMA("AUDCAD",PERIOD_M15,500,0,MODE_SMA,PRICE_CLOSE,1);
         AUDCAD_M30_50_MA = iMA("AUDCAD",PERIOD_M30,50,0,MODE_SMA,PRICE_CLOSE,1);
         AUDCAD_M30_300_MA = iMA("AUDCAD",PERIOD_M30,300,0,MODE_SMA,PRICE_CLOSE,1);
         AUDCAD_M30_500_MA = iMA("AUDCAD",PERIOD_M30,500,0,MODE_SMA,PRICE_CLOSE,1);
         AUDCAD_H1_50_MA = iMA("AUDCAD",PERIOD_H1,50,0,MODE_SMA,PRICE_CLOSE,1);
         AUDCAD_H1_300_MA = iMA("AUDCAD",PERIOD_H1,300,0,MODE_SMA,PRICE_CLOSE,1);
         AUDCAD_H1_500_MA = iMA("AUDCAD",PERIOD_H1,500,0,MODE_SMA,PRICE_CLOSE,1);
         AUDCAD_H4_50_MA = iMA("AUDCAD",PERIOD_H4,50,0,MODE_SMA,PRICE_CLOSE,1);
         AUDCAD_H4_300_MA = iMA("AUDCAD",PERIOD_H4,300,0,MODE_SMA,PRICE_CLOSE,1);
         AUDCAD_H4_500_MA = iMA("AUDCAD",PERIOD_H4,500,0,MODE_SMA,PRICE_CLOSE,1);
         AUDCAD_D1_50_MA = iMA("AUDCAD",PERIOD_D1,50,0,MODE_SMA,PRICE_CLOSE,1);
         AUDCAD_D1_300_MA = iMA("AUDCAD",PERIOD_D1,300,0,MODE_SMA,PRICE_CLOSE,1);
         AUDCAD_D1_500_MA = iMA("AUDCAD",PERIOD_D1,500,0,MODE_SMA,PRICE_CLOSE,1);
          
         
         
         AUDCAD_H4_ATR= iATR("AUDCAD",PERIOD_H4,24, 1);   
         
         

         
//===========================================================    
//===========================================================                           
   handle=FileOpen("MA ATR 50 300 500 600.csv", FILE_CSV|FILE_WRITE, ',');
   if(handle>0)
    {
     FileWrite(handle, 
      DoubleToStr(AUDCAD_Bid, 5), DoubleToStr(AUDCAD_Ask, 5), 
      DoubleToStr(AUDCAD_M1_50_MA,5), DoubleToStr(AUDCAD_M1_300_MA,5), DoubleToStr(AUDCAD_M1_500_MA,5), 
      DoubleToStr(AUDCAD_M5_50_MA,5), DoubleToStr(AUDCAD_M5_300_MA,5), DoubleToStr(AUDCAD_M5_500_MA,5), 
      DoubleToStr(AUDCAD_M15_50_MA,5), DoubleToStr(AUDCAD_M15_300_MA,5), DoubleToStr(AUDCAD_M15_500_MA,5), 
      DoubleToStr(AUDCAD_M30_50_MA,5), DoubleToStr(AUDCAD_M30_300_MA,5), DoubleToStr(AUDCAD_M30_500_MA,5),
      DoubleToStr(AUDCAD_H1_50_MA,5), DoubleToStr(AUDCAD_H1_300_MA,5), DoubleToStr(AUDCAD_H1_500_MA,5),
      DoubleToStr(AUDCAD_H4_50_MA,5), DoubleToStr(AUDCAD_H4_300_MA,5), DoubleToStr(AUDCAD_H4_500_MA,5),
      DoubleToStr(AUDCAD_D1_50_MA,5), DoubleToStr(AUDCAD_D1_300_MA,5), DoubleToStr(AUDCAD_D1_500_MA,5),
         
      DoubleToStr(AUDCAD_H4_ATR, 5)

     );

     FileClose(handle);
     Comment(" MA_ATR 50 300 500 600 SENT ");
    }

    return(0);
  }
 
Alain Verleyen:

See :

I have this issue only with your posts, nobody else, so must be something on your side.

It happened because I added a dark mode add-on to my browser.

I will be careful when I post in the future.