Topics
16 Sep 2019, 18:05
 1073
 6
Replies

bhavd85
17 Sep 2019, 13:29

RE:

Panagiotis Charalampous said:

Hi Bhavin Dholakia,

HasCrossedAbove and HasCrossedBelow tell you the direction of crossing. If you want to implement this on a tick based strategy you can compare the value of the ema with the previous and with the current tick. If you clarify what do you need exactly, I can provide you with an example.

Best Regards,

Panagiotis

 

Okay here is what i would like my algo to do:

 

On the pair GBPJPY - Currently trading at 130 with EMA 28 currently at 129.8, I would like the algo to generate a buy order at 129.8 when the market hits that price. The inverse is also true...so if GBPJPY is trading at 129.50 and EMA28 is 130 I would like the algo to generate a sell order at 130 when the market hits that price. I do not want the price to cross over the EMA simply for the bid/ask to hit the price of the EMA and generate a market order in the required direciton

 

 


@bhavd85

bhavd85
17 Sep 2019, 11:01

RE:

Panagiotis Charalampous said:

Hi Bhavin Dholakia,

Thanks for posting in our forum. Why do you need a special function for this? Current prices can be found in Symbol.Bid and Symbol.Ask and the latest EMA value can be found in the ema.Result.LastValue property. You can use them to make any comparison you like.

Best Regards,

Panagiotis

Hi Panagiotis

 

thanks for your reply, the above methods do not tell me the direction of the price though  (unless i misunderstand how to use them). My strategy needs to generate a trade based on the direction it touched the EMA, example if the EMA is below the current price...the price moves down to touch it it would generate a market buy at the EMA price.


@bhavd85