
You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register
It would be very odd and I don't think that is what is happening . . . I don't know what is causing your issue to be honest, but clearing up any other little problems might help you with some clarity and help you get to the root cause. I did see a possibility that a Long and a Short could be opened together, but not 2 longs or 2 shorts.
Are you running this in the Strategy Tester or Demo ? or maybe both ?
I am running in Demo. I will clean this up and test again on Sunday/Monday and see if I can get more info on it. Thanks
The only mistke I can see is in thinking that the magic number will increase.
Sorry this a repeat but I thought you might have missed it.
Juat a thought but will not tradecounter always be one and you seem to wish to use it as a magic-number in ordersend to state the order in which the trades were created?
As this is an extern variable, it should not initialize to 0 every time start() is executed so it should always increase by one. Having said this, I am basing this on how the previous platform I used ( Strategy Trader) and assume it will work the same, but it is a good point anyway so I will check. Thanks.
I am running in Demo. I will clean this up and test again on Sunday/Monday and see if I can get more info on it. Thanks
You are counting up but do it also wrong if counting up then
But checking trades make it normal to count down check trades
then it will be like
You are counting up but do it also wrong if counting up then
But checking trades make it normal to count down check trades
then it will be like
Thanks deVries and RaptorUK
I am not sure why it is important to count down instead of up, but thanks for catching the following error.
I fixed this and all the other errors caught by RaptorUK and now the transactions are not getting duplicated. This last error could explain why I did not catch the trade as I was missing one iteration, however, it still sounds unlikely that it only happens the first time around. But anyway, the good thing is that it is fixed so I can move on.
Also thanks for suggesting the strategy tester. It speeds development testing quite up a lot.
One last question although not related to this topic: Are the time frames only limited to the time frame enumeration values? or could you use 180 value for a three hour time frame like the following?
Thanks deVries and RaptorUK
1. I am not sure why it is important to count down instead of up, but thanks for catching the following error.
2. One last question although not related to this topic: Are the time frames only limited to the time frame enumeration values? or could you use 180 value for a three hour time frame like the following?
1. counting down is a must if you are deleting or closing orders: Loops and Closing or Deleting Orders
2. you can use the standard timeframes or other timeframes if you have created them in advance.
1. counting down is a must if you are deleting or closing orders: Loops and Closing or Deleting Orders
2. you can use the standard timeframes or other timeframes if you have created them in advance.
Thanks that is a very good explanation how the positioning works for OrderSelect().
Sorry for the dumb question but I not sure how to create a time frame in advance. Do you have a link or topic that discusses this?
Sorry for the dumb question but I not sure how to create a time frame in advance. Do you have a link or topic that discusses this?
You need to create it as an offline chart and create the history (hst file), you can use period converter.