Reduce Lot

 
hello,

i want reducing lot after equity reach some number ie:
start equity = $5000
lot = 1
then equity increase = $7500
i want next open order with 0.5 lot
how to code this? or somebody have sample or link i can learn
Any help is appreciated
 
double lot = 1.0;
if( AccountEquity() > 7500 ) lot = 0.5;
OrderSend( Symbol(), OP_BUY, lot, ... );
 
thanks a lot fireflies :)