Your code seems right to me: each time the fast DEMA crosses over the slow DEMA, the system buy 5 contracts.
hi Nicolas ,
but the systems does it only ONCE a time …
Just update your code with my last example about the bollinger bands and you’re ok.
sorry don’t understand what you mean …just to make sure… I do not like to have just one execution on the day… so always if the lines cross over the system should buy ……
hi niciolas , I found the solution ón my own thx,
hi Nicolas
hi everybody ,
is there a chance via proreal to do an strategie on EMA (Exponential moving average 21,55) on German Dax for example
I found DEMA which seems not to be t he same
thx
regards
If you mean change your actual strategy of this post, with EMA instead, why do not make it yourself?
it s a generall question ….ema is not available on proreal ? … or am i wrong
Hi Dreif
Strangely, although EMA is not available to add to a Chart; EMA is available using Fx when coding an Algo … see attachment
GraHal
nicolas , not helpful your post … an answer with yes or no would be more helpful ….
@GraHam
Just add a “Moving Average” from the indicator selection window and then change its calculation mode from there (5 or 6 possible options: from SMA to Hull MA, etc..)
@dreif123
If you need to code a strategy with EMA, this link will lead you to an exponential moving average instruction example.
Haha @Nicolas … I have selected EMA (as you say) several times, but forgot … I need to slow my brain when helping others, but thanks for the reminder 🙂
Hi
I just wanted to say thanks. The ‘do only one trade a day’ has been something I’ve really struggled to code for ages and your suggestion (using lasttradedate and opendate) worked perfectly!
Made my day!
Andy
Hi Andy
Might you be able to share your code for ‘do only one trade a day’ please? This would ‘close the loop’ and make this thread a useful future reference for the Community.
Thank You
GraHal
Sure,
//I have this line at the beginning of my code after the defparams
Once LastTradeDate = 0
//Then this line after MyBuyCondition is defined
ConditionTradedToday = LastTradeDate <> OpenDate
//Then
IF MyBuyCondition AND ConditionTradedToday THEN
Buy 1 LOT AT MARKET
SET TARGET PROFIT 10
SET STOP LOSS 10
LastTradeDate = OpenDate
ENDIF
//Hope that helps, this works on a 5m chart on wall street index on IG