Welcome to NexusFi: the best trading community on the planet, with over 200,000 members Sign Up Now for Free
Genuine reviews from real traders, not fake reviews from stealth vendors
Quality education from leading professional traders
We are a friendly, helpful, and positive community
We do not tolerate rude behavior, trolling, or vendors advertising in posts
We are here to help, just let us know what you need
You'll need to register in order to view the content of the threads and start contributing to our community. It's free for basic access, or support us by becoming an Elite Member -- discounts are available after registering.
-- The NexusFi team
(If you already have an account, login at the top of the page)
// TrdQty = IntPortion(TradeCost/(100*Close));// Round off the entry contracts.
Position = IntPortion(TradeCost/(100*EntryPrice)); //Actual Position Contracts.
ActualCost = Position * EntryPrice * 100;
StopAmt = ActualCost * StopLossPct/100;
FloorAmt = ActualCost * (BreakEvenPct/100);
{Determine if current time is within valid market session by setting
the TradeOK to TRUE which will allow new position to be opened (traderslaboratory.com)}
if (Time > TradeTimeStart) AND (Time < TradeTimeEnd) then
TradeOK = True;
If date <> date [1] then begin
yesterdaynet = NetProfit;
end;
if MarketPosition = 0 then begin
todaynet = NetProfit - yesterdaynet;
condition1 = -dailyloss < todaynet;
Your "EntryPrice" variable is causing a division by zero error Set the initial variable value to something other than "(0)". then maybe add something like:
Honestly, i have no idea what your trying to do with the code but that's the first thing that jumped out at me.
Also, you will get alot more help at Multicharts discussion Forum
hope this helps you, good luck.
I have approximate answers, possible beliefs and different degrees of certainty of different things. But I'm not absolutely sure of anything and there are many things i don't know anything about.
what makes it very hard to help you is the amount of information you provided besides your script.
For example what does "forever" mean - seconds, minutes, hours... eternity? How many days of data did you load on what symbol and timeframe? What were your settings for the bar magnifier? There are so many variables that could explain why code took a while to calculate. With your code not being overly complex I would expect the reason to be somewhere to be found within the points I mentioned.