Counting Variable
2 replies
Easy-Read
7 years ago #115215
Is there any easy way of counting with EAs?
e.g. if 9/10 of the last ten candlesticks > EMA 20 then Open Order
e.g. if an event has happened once within a specific time period and you opened an order, don’t open another order within this time period.
I presumed it would be a case of setting a variable to be zero in the strategy paramenters then adding one every time an event occurs but I can’t seem to get that to work
tomas262
7 years ago #137581
I can make an example for this. You also upload what you have done so far. It is easily done by setting up a variable and then increasing its value with “Addition” function like
var1 = Addition(var1, 1)
A simple example on how to count trades per day is also here https://strategyquant.com/forum/topic/4377-limit-number-of-trades-per-day/
Let me know if you are lost and need an example 🙂
Easy-Read
7 years ago #137997
Thanks Tomas
Viewing 2 replies - 1 through 2 (of 2 total)