My first script that needs to be optimized based on MACD and AO

This is my first script here.
I need to understand how to set take-profit and stop-loss based on price and not on ticks, moreover I need to understand how to set time frame.

Thanks to who wants to help
Trend Analysis

Disclaimer