You are correct, if I had an exact number than ur suggestion would work like a charm however the issue is entryprice plus xyz number changes because that number is based on the entry price.@Learnbot I just tried it with your code and it works. The "target" in my code is different from your code so change "target" to some number.
Code:AddOrder(OrderType.SELL_TO_CLOSE, close >= (entryprice + .25) or close <= (entryprice - .10), close[0], tradeSize, Color.MAGENTA, Color.MAGENTA);
sorry to make it super complicated, but i know I am not explaining the exact thing I’m trying to do. Let me try and explain it a little better
so I have a buy condition based on ben’s script, let’s say if condition A meets then I place an order Aka
Code:
input tradeSize = 100;
AddOrder(OrderType.BUY_TO_OPEN, IN, open[-1], tradeSize, Color.CYAN, Color.CYAN);
so the code above buys 100 shares at specific price correct? So my biggest issue is I need a script that tells TOS what that price is because my exit strategy is based on risk reward.
so let’s say the above code bought 100 shares at 100$ per share, I want the exit order to trigger IF the current bar’s close is either $102 (target) or price falls down to $98 (stop loss).
(my stop loss is basically risk reward scenario, I’m risking 2% to make 2%)
hope this clarifies what I’m trying to do And the reason I’m doing this is because not all strategies provide 1 to 1 or 1 to 2 or so on risk rewards, some strategies produce better winning percentage if the RR is correct for that specific strategy.
Last edited by a moderator: