Bar close prices

Created at 16 Jan 2023, 23:25
How’s your experience with the cTrader Platform?
Your feedback is crucial to cTrader's development. Please take a few seconds to share your opinion and help us improve your trading experience. Thanks!
PA

parkermark446

Joined 16.08.2020

Bar close prices
16 Jan 2023, 23:25


I have a simple bot that executes buy and sell orders when price hits a moving average,what I'd like to do is rather than execute these orders when price hits the moving average is execute the order when the candle closes after passing over the moving average.

I'm not c# expert but I'm slowly learning (copy and paste style)to create bots.If any of you nice people could help me this would be most grateful. 


@parkermark446
Replies

PanagiotisChar
17 Jan 2023, 09:15

Hi there,

What exactly do you need? A complete cBot? A line of code? Please make your request more explicit.

Aieden Technologies

Need help? Join us on Telegram

Need premium support? Trade with us

 


@PanagiotisChar

Shares4UsDevelopment
20 Jan 2023, 19:58 ( Updated at: 20 Jan 2023, 19:59 )

RE:
if(Bars[Bars.Count-2].Close > MovingAverageIndicator.Result[Bars.Count-2])
{
//do the trade
}

 


@Shares4UsDevelopment