Previously displayed bid or ask prices

Created at 17 Dec 2012, 22:40
How’s your experience with the cTrader Platform?
Your feedback is crucial to cTrader's development. Please take a few seconds to share your opinion and help us improve your trading experience. Thanks!
BA

Balena

Joined 17.12.2012

Previously displayed bid or ask prices
17 Dec 2012, 22:40


Probably a silly question, but new here...

reading all posts... but not finding...

How can I get the Bid or Ask that was displayed prior to the current Bid or Ask?

THANKS!


@Balena
Replies

Balena
18 Dec 2012, 17:29

RE:
Balena said:

Probably a silly question, but new here...

reading all posts... but not finding...

How can I get the Bid or Ask that was displayed prior to the current Bid or Ask?

THANKS!


Help Please...


@Balena

admin
19 Dec 2012, 17:56

RE: RE:
Balena said:
Balena said:

Probably a silly question, but new here...

reading all posts... but not finding...

How can I get the Bid or Ask that was displayed prior to the current Bid or Ask?

THANKS!


Help Please...

Hello,

Do you want this for an indicator or a robot? Can you please clarify what exactly you want to do? It will help us develop it for you faster!

Thank you in advance


@admin

Balena
19 Dec 2012, 21:44

thanks for inquiring...

I'm looking to do something like...

if( X < previous Bid)

do this...

or

if (X > previous Offer )

do this...

 

thanks for your help!


@Balena

admin
04 Jan 2013, 11:05

Hello,

The example here is using the OnTick event but you may also use the OnBar instead.

        protected override void OnTick()
        {
            
            if(X < previousBid)
            {
                //...
            }

            else if (X > previousOffer)
            {
                //...
            }
            previousBid = Symbol.Bid;
        }


X and previousOffer are declared as fields and will be set according to your algorithm.

 


@admin