Price optimization with demand forecast I have one year sales data of a retail company and lets say I am forecasting the next month sales for the product. I have got the sales using time series in R. Now I want to forecast the price as well. I want to build a model using both the demand and price. My function should be f(DP) where D is demand and P is price. I want to maximize Revenue or Profit where Revenue=DP.

As of now, I forecasted sales and did a linear programming on Price itself to get optimal price of a single product. I want my model to be robust but this is chicken - egg theory where demand forecast is dependent on the price and price is dependent on demand. Please help by sharing some theories which would better fit for this or some R models.
First, You may model the sale or demand as a function of price. You can use a regression model to control for controls. This regression will provide you with price elasticity of demand which show how your demand is sensitive to a change in price.
Then, you may use the above relationship to plug in for sale in the optimization step. This way you only solve for the optimum price.