how to store a Bid Ask price when condition hits?

 

I tried to lock the bid price but it did not work

if(price>0 && Ask<=price-70pips) 
{
  OrderSend(Symbol(),OP_BUY,0.01,Ask,slippage,sl, tp,"",Magic,0,Blue);
}

I dont want the condition to execute first..i want it to capture the price first and when the price is below 70 pips then it trigger the condition..

what is the logic that Im missing??

your help are really appreciate thank you!

 
  1. amerul.trader: what is the logic that Im missing??
    Why do you think you are missing something?

  2. What is the difference between buytriggered==true and price!=0?
 
William Roeder:
  1. Why do you think you are missing something?

  2. What is the difference between buytriggered==true and price!=0?

buytrigger & price is to initiate and reset the value..

but its not working the Ask price will always took the current Ask

 
amerul.trader:

buytrigger & price is to initiate and reset the value..

but its not working the Ask price will always took the current Ask

  1. buytriggered && price>0
    I asked "what is the difference?" Answer the question.
  2. It is working. You can only buy at the Ask.
 
Why you need to store price if condition meets? 
 
Ahmet Metin Yilmaz:
Why you need to store price if condition meets? 

theres 2 condition.. if rsi >90 i dont want it to execute first but i want the static price when it trigger the condition.then use the static price minus another  70 pips to execute the order.

 
amerul.trader:

theres 2 condition.. if rsi >90 i dont want it to execute first but i want the static price when it trigger the condition.then use the static price minus another  70 pips to execute the order.

So you can create a waiting order with ask price minus 70 pips
 
amerul.trader:

theres 2 condition.. if rsi >90 i dont want it to execute first but i want the static price when it trigger the condition.then use the static price minus another  70 pips to execute the order.

nope.. i want it to execute as market order..not pending order

 
amerul.trader:

nope.. i want it to execute as market order..not pending order

So you can create static array
 
William Roeder:
  1. I asked "what is the difference?" Answer the question.
  2. It is working. You can only buy at the Ask.

no different. both logic are same i think..can either use 1 only.

 
Ahmet Metin Yilmaz:
So you can create static array

why do you suggest with array? can you provide example?