Pi tradescript: Can we raise, maintain & cancel an order?

Hi,

Is it possible to create a custom trailing stop loss order using Pi tradescript? My exact plan is to implement this.

Scenario: Create a buy order at 1.00 (100 shares) with a sell order at .80 (200 shares)

  1. When the LPT hits 1.20, we edit the sell order's limit price to 1.00 just like the default trailing stop loss.
  2. When the LPT hits .80, we create a new buy order at 1.00.


And the loop goes on. Its like trading in the Renko chart with brick size 0.2 points.

Any simple guidance would be a great help for me. So don't hesitate to answer any thing you know regarding this.

Edit: One more doubt: My stop loss is at .80 and LTP jumps to .75, Now, which of the below two is effective?

  • Having a stop loss order placed already at .80.
  • Raising the stop loss(buy/sell script) from Pi at that time.


I believe, the order placed already have some advantage. Is that right?

Thanks,
Karthick.

As per the above condition it is not possible with tradescript

1 Like

Thank you AlgoGeek,
Is it possible to do it in AmiBroker?