PDA

View Full Version : How to find out the current market price?



Laumamivemo97
03-27-2009 21:13, 09:13 PM
Im attempting to shut an order by:

if(OrdersTotal()==1)

OrderClose(16384,1,Ask,3,Red);



But what I want to mention is something like:
if(the current price is greater then RectanglePriceMax OrdersTotal()==1)

OrderClose(16384,1,Ask,3,Red);



How do I mention that? The current price is greater lt;my variablegt; ?

OxmiokSP
08-20-2023 08:34, 08:34 AM
If(Bidgt;myprice OrdersTotal()==1) - Also close BUYS at the 'Ask' and SELLS with all the 'Bid' price.

Laumamivemo97
08-20-2023 09:55, 09:55 AM
Thanks so much ... perhaps I can ask you a math question?

I have two factors...

RectanglePriceMax (1.42000)
RextanglePriceMin (1.43000)

These hold worth of currency's... examples are in (above)



I need to find the difference of how many pips are in between them, and IF SMALLER then 50, to conduct the if statement...

So I think its :

int var3 = 0;
var3 = RectanglePriceMax - RectanglePriceMin;

if (var3 lt; 50)

stuff



but for some reason I do not get the expect consequences, is this right?

bmigisg
08-20-2023 11:15, 11:15 AM
Var3 = (RectanglePriceMax - RectanglePriceMin)/Stage;

this will definitely get you the difference in pips. How you had it before the value could always be less than 50.

Laumamivemo97
08-20-2023 12:36, 12:36 PM
Thanks , wicked, worked like a charm!