Help newbie simple code

#1
Hi,
Firstly, thanks you very much because of helping me
Secondly, im completely new

I want to run back test
Sell when price decrease 10% compare to buy price or decrease 10% compare with highest price in last 10 day

please help me this afl code for ami
thanks a lot
 

vijkris

Learner and Follower
#3
Hi,
Firstly, thanks you very much because of helping me
Secondly, im completely new

I want to run back test
Sell when price decrease 10% compare to buy price or decrease 10% compare with highest price in last 10 day

please help me this afl code for ami
thanks a lot
bro, I m an amateur in coding, still, few doubts in ur strategy.
1. only sell, no buy? that means is it short only strategy?
2. "Sell when price decrease 10% compare to buy price ", how can buy price be defined without buying anything? :annoyed: :confused:
3. Is this strategy applicable for intraday charts or daily charts? :confused:
4. for backtesting u need to define ur exit criteria also, it is missing :annoyed::annoyed:
 
Last edited:
#4
bro, I m an amateur in coding, still, few doubts in ur strategy.
1. only sell, no buy? that means is it short only strategy?
2. "Sell when price decrease 10% compare to buy price ", how can buy price be defined without buying anything? :annoyed: :confused:
3. Is this strategy applicable for intraday charts or daily charts? :confused:
4. for backtesting u need to define ur exit criteria also, it is missing :annoyed::annoyed:
hi, thanks for help
im not good at english really much

I want to buy when volume 3 time as normal

Sell when:
Current price = 90% of buy price
or Current price = 90% of highest price in 10 day

Example: Buy 10 -> sell when price <9
(all price above is close price)

Please help, thanks a lot
 
#5
I want to buy when volume 3 time as average of 100 day

Sell when
1,price < 90% buy price ex: buy: 10$, sell if price < 9$
or 2, price < 90% of highest price in 10 day from the buying day

exp: Buy: 14/2 10
price 11 12 10 11 12
day 15/2 16/2 17/2 18/2 19/2
=> sell at 10$ in 17/2

(all is closing price of a day)
thanks you
 
#6
I want to buy when volume 3 time as average of 100 day

Sell when
1,price < 90% buy price ex: buy: 10$, sell if price < 9$
or 2, price < 90% of highest price in 10 day from the buying day

exp: Buy: 14/2 10
price 11 12 10 11 12
day 15/2 16/2 17/2 18/2 19/2
=> sell at 10$ in 17/2

(all is closing price of a day)
thanks you
sorry for this stupid thing

Simple:
I want buy when volume in closing day > 3 * EMA of volume in 100 day before

Sell: closing price < 10% of highest price from day I buy

Ex: Buy 10
price 10 11 12 14 11
day 0 1 2 3 4
( Sell at day 4)

Hope its clear
Please help me,
Thanks a lot
 

Similar threads