Guys I need help.
Can anyone tell me why if I run the attached code in debug mode it seems to be working fine, while if I run it regularly it does not?
I am trying to modify the experimental version in order to add Individual Basket Trailing Stop Percentage.
I am not a skilled coder and its taking me forever with lots of trials and errors, but I have now reached a point where I do not really know what else to do.
If I debug the code it seems to be working just fine but when I launch it regularly it does not.
Following are 2 screenshots where you can see the code running in debug mode and regularly.
Debugging1.PNG
Notice that in debug mode the white column inside the matrix titled "IBTS" is updating just fine.
All of this values apart for the last one are computed inside CanIndividualPairBasketBeClosed(string symbol, int PairIndex); the last one is the value of CashUpl[PairIndex]
Debugging3.PNG
I took the above a few minutes in and USDCAD reports "T1.93/1.20/0.73/0.73/1.67"
T means that the Individual Basket Trailing Stop is currently in operation (IBTSActivatedCash[PairIndex])
1.93 is the individual basket high (IBTSHighValueCash[PairIndex])
1.20 is the cash stop loss (IBTSStopLossCash[PairIndex]) meaning that if price reverse we will take home 1.20EUR.
0.73/0.73 are respectively the computation of IndividualBasketTrailingStopStartValueCash[PairIndex] and IndividualBasketTrailingStopGapValueCash[PairIndex]
1.67 as described above is CashUpl[PairIndex]
From this output I think that the code I added is working or at least its computing these values correctly.
Look at the following image now, this time the EA is launched regularly.
Normal run.PNG
You can see that all of the white column reports all F and no values gets computed in the remaining fields apart for the first raw and CashUpl[PairIndex] that is computed elsewhere.
I'll attach the modified code below.
The settings I used have been embedded inside the code, so no need for a set file.
Every feedback will be appreciated.
Thanks!
You do not have the required permissions to view the files attached to this post.