Within live automated trading, if I reference Insidebid within an initial calculation, (with IntrabarOrderGeneration = true) for example:
Code: Select all
myBid = Insidebid ;
SwingHighValue = SwingHigh( 1,high,2,50); //most recent swing high over last 50 bars
If myBid > SwingHighValue then
SwingTest = true ;
Code: Select all
If myBid < SwingHighValue + SlippagePips then
SlippageTest = true ;
Code: Select all
If SwingTest = true and SlippageTest = true then
Buy ( "Long" ) 100 contracts next bar market ;
Coming from an MQL4 background where in order to obtain the latest bid/ask price you would use RefreshRates() each time and if you didn't the bid and asked stayed the same as when last called regardless of what they currently are. Wasn't sure how InsideBid and InsideAsk worked in this regard.
Many thanks.