Hellow,
I am new to alogo world and I have simple process which works on two different trading account and I want to know is my statergies are codable and if yes then I want to backtest this please help.
Let us assume stock name is ‘xyz’ and its initial cmp is Rs.1000 and total quantity of stock is 500.
STATERGY ‘A’ at 1st account:-(When stock moves up)
1-Buy 250 quantity of xyz at CMP(Initially it Rs.1000 as process continues it would be different).
2-Put trailing stoploss of Rs. 1.
3-If stoploss hits at a price lower than Buy price i.e.Rs. 999 and then after if stock moves up from stoploss hit price by Rs 1 i.e. stock price is now Rs. 1000 then again repeat step 1,2,3 and 4 same as above to continue this process.
4-If stoploss hits at a price higher than Buy price i.e. Rs. 1001 or 1002 or 1003etc. ,then as stoploss order executes again repeat step 1,2,3 and 4 to continue the process.
STATERGY ‘B’ at 2nd account:-(When stock moves down)
1-Shortsell 250 quantity of xyz at CMP (Initial Rs. 1000 as process continues it would be different).
2-Put trailing stoploss of Rs.1
3-If stoploss hits at a price higher than shortsell price i.e.Rs. 1001 and then after stock moves down from stoploss hit price by Rs 1 i.e. stock price is now Rs. 1000 then again repeat step 1,2,3 and 4 same as above and continue this process.
4-If stoploss hits at a price lower than shortsell price i.e. Rs. 999 or 998 or 997etc. ,then as stoploss order executes again repeat step 1,2,3 and 4 to continue the process.