Counting Variable

2 replies

Easy-Read

Customer, bbp_participant, community, 10 replies.

Visit profile

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

0

tomas262

Administrator, sq-ultimate, 2 replies.

Visit profile

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 🙂

0

Easy-Read

Customer, bbp_participant, community, 10 replies.

Visit profile

7 years ago #137997

Thanks Tomas

0

Viewing 2 replies - 1 through 2 (of 2 total)