Forum

Program stops the tester

I'm not understanding why the tester is stopping. It should go back to the beginning and start the checks again when all my statements end up being false right? I have done my best to comment everything and print statements to easily follow the path as its running. I have highlighted where it stops

for loop questions

So I either do not understand for loops or visibility scope or both. I am just trying to loop through the history of my MA's and make sure they have not crossed over each other in a certain amount of time before I move on to my next criteria checks. For some reason I cant seem to get the loop to

Not sure why my code is breaking the back tester.

I am working on a new idea and for some reason I cant see why the back tester is just stopping. Its got to be something simple I'm missing. I have set up many print statements to find out where the code is stopping and I have highlighted the code where I cant get it to move past. I run other bots I

Checking if a function is true

I am trying to check if I already have an order open and if I do, make sure that it is either a long or a short. It seems like instead of my "if" statement checking to see if the bool function is true or not the program is just running the function its supposed to be checking. There are other issues

alternative to ST and TP

My first issue is this: I use Oanda. I am in the US and we have the FIFO rule. Basically if I put a ST or TP on my order then I cannot send another order of the same size unless the previous order has been closed. The first order placed must be closed before another order can be bought. This only

trades placed by EA when they should not

I am experiencing an issue. When I place the EA on my chart it buys or sells even when it should not. after the initial trade it makes imeadiatly when its placed on the chart, it begins running normal. I have a poor internet connection here and if I lose connection and then it comes back it will

does the back tester use margin?

I have finally got an EA working and taking all winning trades. it dont trade often but when it does it wins. However I am using a high stoploss and I dont know if its taking into account margin . This would change things in the real world if I couldn't cover my margin waiting for the take profit to

error 130

I have been getting this error and I cant seem to figure out the cause. I have been trying for the last 3 days to figure it out. I assume its because of my send order operation so I have adjusted everything I can think of. Nothing seems to stop it from appearing in my journal during backtesting. one

not all control paths return a value.

ok I have tried to find an answer but I'm not seeing it. I have searched the forums but none of the solutions seem to apply to me. I'm probably wrong though. the error is on the final "}". Thanks for your patience. //Function to Check the last 100 candles(trendLegth) to look for a trend bool

Wont purchase during back test

I'm trying out a new bot idea and I cant get it to purchase or sell during back testing. basically this bot looks at the last 6 bars including the newest one and decides if it is a valley or a peek and puts in a buy or sell order depending on each scenario. any help would be appreciated. void OnTick