How do code for the following:

How do we code for the following:

BUY 100 Stock of X at Rs 100 and

STOP LOSS is Rs 98.

If Target 1 Rs 102 Reaches sell 50 % of stocks ie 50 stocks ,

Target 2 Rs 104 sell 35 % of stocks and at last Target 3 Rs 106 sell remaining 15% of Stocks

In Tradescript we can code on basis of OHLC ( open, high, low, close) , with price values can not be coded.‚Äč

but cant u code(pls correct me if wrong):
for entry:
LAST>100
FOR EXIT:
LAST<98 OR LAST>102 OR LAST>104
or maybe:
REF(LAST,0) > 100