will that meet the intension?

 

Hi,

please if s.o. can confirm or tell me a mistake or if s.th. is missing except the the code to admin. the targets before and after this:

I want to catch if the new target for a buy-position is too close to the actual price:

double pointProfitBuyTarget = (qtsTarget - Bid)/Point;
if (pointProfitTarget <= MathMax( 
                           MarketInfo(Symbol(),MODE_FREEZELEVEL), 
                           MarketInfo(Symbol(),MODE_STOPLEVEL) ) 
   hideTarget(qtsTarget);
else 
   sendNewTarget(qtsTarget);

Is that enough or have I forgotten s.th.?

Thanks in advance,

gooly

 
gooly:

Hi,

please if s.o. can confirm or tell me a mistake or if s.th. is missing except the the code to admin. the targets before and after this:

I want to catch if the new target for a buy-position is too close to the actual price:

Is that enough or have I forgotten s.th.?

Is this for a Buy, Sell or both ? let this guide you, it's all here: Requirements and Limitations in Making Trades
 
RaptorUK:
Is this for a Buy, Sell or both ? let this guide you, it's all here: Requirements and Limitations in Making Trades


it's a buy position: pointDifference = (qtsTarget - Bid)/Point
 
gooly:

it's a buy position: pointDifference = (qtsTarget - Bid)/Point

Shouldn't this . . .

                 MathMax( 
                           MarketInfo(Symbol(),MODE_FREEZELEVEL), 
                           MarketInfo(Symbol(),MODE_STOPLEVEL) ) 

be this ?

                  MathMin( 
                           MarketInfo(Symbol(),MODE_FREEZELEVEL), 
                           MarketInfo(Symbol(),MODE_STOPLEVEL) ) 


You should give some thought about how you are comparing these double values, what will happen of they are equal as a price but not equal as doubles ?

 
If freezelevel isn't being used its value is zero. If you're closer than either (less than max) you can't modify the trade.
 

yep - that was my intention,

thanks WHRoeder!