Download MetaTrader 5
To add comments, please log in or register
Publish your article and get a reward!
Johnathan
7
Johnathan 2015.04.16 00:43 

Hi,

 

I'm trying to figure out a way to create user defined variables based on the Bid and Ask price that will be set when the Expert starts and that stay the same until the Expert is de-initialized or the values are changed programatically. In other words I don't want the value of my variables to go up and down as the price moves.  I'm guessing it's probably something simple but I can't find or figure out how to do it.  For Example:

 

OriginalAsk = Ask;

OriginalBid = Bid; 

 

Thanks in advance

 

whroeder1
13644
whroeder1 2015.04.16 01:25  
jrobinson3002: I'm trying to figure out a way ...
  1. Was this so hard you couldn't even attempt it?
    bool isFirstTick = true;
    double OriginalAsk, OriginalBid;
    OnTick(){
       if(isFirstTick){
          isFirstTick = false;
          OriginalAsk = Ask;
          OriginalBid = Bid;
       }
       :
  2. learn to code it, or pay someone. We're not going to code it FOR you. We are willing to HELP you when you post your attempt (using SRC) and the nature of your problem.
Johnathan
7
Johnathan 2015.04.16 02:32  

Thanks a lot WHRoeder

 

This is my first Expert and I'm actually proud I have created a few hundred lines of code from scratch with no help but this was just something that maybe was a bit of a mental block that stumped me for some reason. I was just making it way too complicated in my mind. Now looking at it, it looks obvious and really simple. Thanks again.

/
To add comments, please log in or register