Jump to content

Welcome to the new Traders Laboratory! Please bear with us as we finish the migration over the next few days. If you find any issues, want to leave feedback, get in touch with us, or offer suggestions please post to the Support forum here.

  • Welcome Guests

    Welcome. You are currently viewing the forum as a guest which does not give you access to all the great features at Traders Laboratory such as interacting with members, access to all forums, downloading attachments, and eligibility to win free giveaways. Registration is fast, simple and absolutely free. Create a FREE Traders Laboratory account here.

Tradewinds

Object-Oriented Programming OOP

Recommended Posts

Great idea ... I'm a programmer by trade so I will be more than happy to help and answer questions ... bring them on!

 

MMS

 

When you first learned OOP basics, can you recall anything that didn't make sense to you? Did you learn it quickly? Are there things that quickly made sense to you? Was there anything about OOP that took a while for you to understand? Did you need to develop a different way of thinking? Is there anything about OOP that you confuse with procedural programing? Is there anything about OOP that you still make a mistake on? These are the kinds of things that I'd be interested in hearing about; from you or anyone else.

Share this post


Link to post
Share on other sites
When you first learned OOP basics, can you recall anything that didn't make sense to you?

 

This applies to programming in general but understanding and being able to program something using recursion. Once you understand this, OO becomes much easier as you are now able to think about objects\reuse\etc in an abstract way.

 

Did you learn it quickly? Are there things that quickly made sense to you?

 

Too me, basic OO is just a way to organize data\code into useful, self-contained things - called objects. So instead of having 10 variables and 50 procedures\functions in a file, instead you have 5 objects each with 2 variables with 10 functions\properties each. So coding and understanding this is easier as you are breaking the problem down into something smaller and more manageable.

 

Was there anything about OOP that took a while for you to understand? Did you need to develop a different way of thinking?

 

Now there are advanced features of OO that took some more practice, like Inheritance and Polymorphism. These features are there to help reuse code. Summary:

1. Objects - used to organize code\functionality

2. Inheritence\Polymorphism - ways to reuse code and reduce copy\paste

 

Is there anything about OOP that you confuse with procedural programing? Is there anything about OOP that you still make a mistake on? These are the kinds of things that I'd be interested in hearing about; from you or anyone else.

 

I would say a common mistake is for people to 'over-engineer' their object hierarchies and incorrectly implement Inheritance and Polymorphism. I've seen OO programs much more damn confusing than a procedural programs. It all depends on using the tools correctly. OO gives plenty of rope for people to hang themselves with.

 

But given the complexity of software today, some applications would be nearly impossible without OO.

 

thx

MMS

Share this post


Link to post
Share on other sites

When OO came on the popular computing scene ~25 yr ago (largely due to the availability of personal computer to the general public), it was all hype and hoopla, it was the best thing invented since sliced bread. It was the "future" of programming.

 

25 years later, I am surprised to see TS taking it on as a trading language.

 

My personal take (only personal 2 cents' worth) -- it is a waste of otherwise useful and productive time for the non-programmers (especially traders) trying to learn and implement any serious and extensive OO programming project.

 

OO programming is a craft, not a skill.

It requires dedication and discipline to learn.

It requires total immersion to learn it well. (object thinking is a paradigm shift)

It requires practice practice and practice

(ie. getting paid to do it professionally on the boss' dime).

 

If you have not touched a piece of EasyLanguage code for 3 months,

you can pick it up and understand the operation immediately.

 

If you have not touched a piece of OO code for 3 months,

it might take you a day(s) to understand the heads and tails of things

(unless it is a very short code).

 

OO is great for big and complicated projects. (eg. a comprehensive autotrade)

EasyLanguage is good for small to medium sized indicators and simple autotrades.

 

For the full time trader and amateur programmer,

my advice is to stick to EasyLanguage and spend your precious time trading and making money, and if you have extra time, go and have fun doing things with the money you earned.

 

Again, don't mean to discourage anybody taking it on... this is only my 2 cents' worth of gut feelings. YMMV.

Edited by Tams

Share this post


Link to post
Share on other sites

Too me, basic OO is just a way to organize data\code into useful, self-contained things - called objects. So instead of having 10 variables and 50 procedures\functions in a file, instead you have 5 objects each with 2 variables with 10 functions\properties each. So coding and understanding this is easier as you are breaking the problem down into something smaller and more manageable.

thx

MMS

 

This sound interesting, and thank you for the feedback. What I'd be interested in seeing is two sets of very simple code, one procedural, one OO. For example, the price breaks the last high. Don't show all the code for how to determine the last high, just assume that we already have that. What would be the object? How would you program the condition of the current close going over the last high? I don't know if you could do it in pseudo code?

 

var: LastHigh(0), NewHigh(False);

NewHigh = Close > LastHigh;  // NewHigh is assigned a value of 'True' when condition met

 

How would OO code be different?

Share this post


Link to post
Share on other sites
What would be the object? How would you program the condition of the current close going over the last high? I don't know if you could do it in pseudo code?

 

var: LastHigh(0), NewHigh(False);

NewHigh = Close > LastHigh;  // NewHigh is assigned a value of 'True' when condition met

 

How would OO code be different?

 

I could see a vendor building the code this way - where the instrument (stock, etc) is the object and things like volume, price, etc. are its properties. e.g.

 

class Stock()
{
 // variables to hold data
 int LastHigh;
 int Close;
 int Price;
 int Volume:

 // properties to return calculated data values
 bool NewHigh {
   return Close > LastHigh;
 }
}

 

Then someone would use this object like so:

 

Stock s = new Stock("AAPL");
if (s.NewHigh == true) BUY!!

 

So it all depends on the framework provided by the vendor. I know NinjaTrader is built with C# so if you program against it, essentially you are using OO. But like Tams said earlier, if the main goal is Trading, it doesn't matter whether it is OO or not, the tool doesn't matter. You just want it to work.

 

thx

MMS

Share this post


Link to post
Share on other sites

25 years later, I am surprised to see TS taking it on as a trading language.

 

My personal take (only personal 2 cents' worth) -- it is a waste of otherwise useful and productive time for the non-programmers (especially traders) trying to learn and implement any serious and extensive OO programming project.

 

I wouldn't care about OO, but I have this code that was created as an example by TradeStation, and it's the only code that I know of that will do what I want. I don't know of any other options. It has to do with running the code, and therefore a clock, independent from having the code calculate dependent upon data ticks.

 

Plus I'm not sure if there is functionality, options available in OO in EasyLanguage not available otherwise. So, in a sense, I feel that I'm being forced to learn two programing languages, and I may need to use both of them in the same indicator.

Share this post


Link to post
Share on other sites
So, in a sense, I feel that I'm being forced to learn two programing languages, and I may need to use both of them in the same indicator.

 

OO is not a new programming language - it more like a new technique of how to use a programming language. C# is a OO language but you can write a program that is 100% procedural in nature. So if it was written in EasyLanguage, you just have to get your head around how they organized the code, and if they used any OO features of the language. You don't have to learn another language. I hope that makes sense ...

 

MMS

Share this post


Link to post
Share on other sites
OO is not a new programming language -

 

Well, yes, you are right OO is not a new programming language. But the reality is, I need to go through a whole new learning process that is just as much work as learning a new language. Actually it's more work, because I already know procedural programing logic, so I could go to another language, and just need to learn the syntax and nomenclature.

Share this post


Link to post
Share on other sites
I wouldn't care about OO, but I have this code that was created as an example by TradeStation, and it's the only code that I know of that will do what I want. I don't know of any other options. It has to do with running the code, and therefore a clock, independent from having the code calculate dependent upon data ticks.

 

Plus I'm not sure if there is functionality, options available in OO in EasyLanguage not available otherwise. So, in a sense, I feel that I'm being forced to learn two programing languages, and I may need to use both of them in the same indicator.

 

can't help you if you have to use a piece of code written by TS in OO.

 

for tasks beyond what EL offers, I would rather go to PowerBasic, or FreeBasic, etc., not OO.

Share this post


Link to post
Share on other sites

Okay, I'd like to go through an entire indicator in OOP, and figure out everything step by step. Let's use the indicator to send an order to the market.

 

Input: string iAccount1( "Enter Your Equities Account Number" ), int iQuantity1(100), PlaceOrderNow(FALSE);

vars: tsdata.trading.Order MyOrder(NULL);

{Called whenever the order status is updated}
Method void OrderStatusUpdate(elsystem.Object sender, tsdata.trading.OrderUpdatedEventArgs args)
begin
UpdatePlots();
end;

{Plots the order status}
method void UpdatePlots()
begin
Plot1(MyOrder.State.ToString()); 
end;

{Send the order when TRUE and sets the method used to handle Order Status Updated events} 
If PlaceOrderNow then begin
{Order sent only once per load in this example}
once MyOrder = OrderTicket1.Send();
MyOrder.Updated += OrderStatusUpdate;
UpdatePlots();
end;

 

First are user INPUTS:

 

Input: string iAccount1( "Enter Your Equities Account Number" ), int iQuantity1(100), PlaceOrderNow(FALSE);

 

This doesn't look any different than with procedural programing.

 

Next are VARIABLES:

 

vars: tsdata.trading.Order MyOrder(NULL);

 

'vars:' is the same, but the variable 'MyOrder' is preceded with some stuff. What is this stuff?

 

tsdata.trading is a Namespace, whatever that means. I guess that 'Order' is the Class, whatever that means. "tsdata.trading.Order" has Properties, Methods and Events, but I don't see anything about creating a variable. Okay, I found something else.

 

tsdata.trading

 

Contains classes that are used to manage trades, positions, and account information.

 

Okay, I can understand about managing trades, managing positions and managing account information. So if I want to manage a trade, I need to somehow use this 'tsdata.trading' Namespace. That makes some sense to me, but I still don't know why they have to call it a 'Namespace' or what a Namespace is. It seems kind of stupid. It's like a generic term that has it's place in some kind of structure, but it doesn't intuitively mean anything to me. So I just need to know that there are these things called 'Namespaces', and they are at the foundation of the hierarchy. I need to deal with them first, or I can't get to the the other stuff. If I don't use the Namespace tsdata.trading, then I can't get to the point where the code actually issues a buy command. Would you say that is correct?

 

So, to declare a variable, it seems like I need to list the Namespace first and attach the 'Order' class to it. But I still have absolutely no idea why I need to list the Namespace and Class before the variable name. And I don't see anything in the help to tell me what the syntax is for declaring a variable. I guess it's just something you need to magically know.

 

Okay, maybe what it does, is set up a relationship with the variable MyOrder to the 'tsdata.trading.Order' thingy so I don't need to type that every time. So I can just type 'MyOrder' instead of 'tsdata.trading.Order'?

 

Anyway, That's enough for now. If anyone can magically make this more understandable, please feel free to comment.

Share this post


Link to post
Share on other sites

Let's move on to the next section:

 

{Called whenever the order status is updated}
Method void OrderStatusUpdate(elsystem.Object sender, tsdata.trading.OrderUpdatedEventArgs args)
begin
UpdatePlots();
end;

 

The above section of code is a subroutine. Don't confuse the Method reserved word with Object Oriented Methods. These are two different things. The above subroutine is named 'OrderStatusUpdate'. The 'OrderStatusUpdate' subroutine runs whenever it is called with the 'OrderStatusUpdate' name. Subroutines created with the Method reserved word can receive arguments passed to it. In this indicator, the call to the subroutine comes later down in the code than the subroutine. Method Subroutines can be called from a line either below or above the subroutine. A sequential programing flow is not required. It looks like the 'OrderStatusUpdate' subroutine is set up to receive a couple input arguments.

 

The first argument is: elsystem.Object sender

 

elsystem.Object is as follows:

 

A base class from which all other classes are derived. Every method in the Object class is available in all objects in the system, although derived classes can and do override some of the base methods. TradeStation HELP

 

'sender' and 'args' are the names given to the input parameters. elsystem.Object is the data type of the input 'sender'. The data type must be put in front of each input parameter name. Okay, 'sender' and 'args' are just named parameters. Sort of like naming variables, but here, the inputs are named.

 

So the Method subroutine will receive data of data types, elsystem.Object and tsdata.trading.OrderUpdatedEventArgs, and those data type names are 'sender' and 'args'.

So this subroutine named 'OrderStatusUpdate' will receive inputs, and then this subroutine calls another subroutine named 'UpdatePlots'.

 

I don't know what the point is of the subroutine 'OrderStatusUpdate' receiving inputs. I don't see that those inputs are used in any way, unless they are then passed on again to the 'UpdatePlots' subroutine. But I don't know if that's what happens or not.

Share this post


Link to post
Share on other sites

Next are VARIABLES:

 

vars: tsdata.trading.Order MyOrder(NULL);

 

'vars:' is the same, but the variable 'MyOrder' is preceded with some stuff. What is this stuff?

 

tsdata.trading is a Namespace, whatever that means.

 

A namespace is used to organize Classes. In large systems, there may be many classes what would have the 'name' Order, so to differentiate between them, you put them into its own 'namespace', which is 'tsdata.trading'

 

Remember my first post about OO being a way to organize code. This is a real-life example of that.

 

I need to deal with them first, or I can't get to the the other stuff. If I don't use the Namespace tsdata.trading, then I can't get to the point where the code actually issues a buy command. Would you say that is correct?

 

To use the correct Order class, you have to declare the correct one by using its 'fullname' - which would be tsdata.trading.Order. So yes to your question.

 

Okay, maybe what it does, is set up a relationship with the variable MyOrder to the 'tsdata.trading.Order' thingy so I don't need to type that every time. So I can just type 'MyOrder' instead of 'tsdata.trading.Order'?

 

No, 'MyOrder' is simply the variable name. A variable must be declared to be of a type, most commonly an integer or a string. But here, it is of type 'tsdata.trading.Order'. So 'MyOrder' is a 'tsdata.trading.Order'

 

I hope my explanations are clear ... some references:

Introduction to Object Oriented Programming Concepts (OOP) and More - CodeProject

 

thx

MMS

Share this post


Link to post
Share on other sites

I don't know what the point is of the subroutine 'OrderStatusUpdate' receiving inputs. I don't see that those inputs are used in any way, unless they are then passed on again to the 'UpdatePlots' subroutine. But I don't know if that's what happens or not.

 

This method is called an 'event handler' (I can tell by the type of the parameters - tsdata.trading.OrderUpdatedEventArgs).

 

An 'event handler' is the method that runs code when the 'OrderStatusUpdate' event happens in your program. These parameters are common to event handlers, as it tells the receiver who triggered the event (elsystem.Object sender) and if there are any arguments for the event (tsdata.trading.OrderUpdatedEventArgs args - this would be data, etc).

 

In this particular example, the parameters are not used but more often than not, these parameters would be used.

 

MMS

Share this post


Link to post
Share on other sites
This method is called an 'event handler' (I can tell by the type of the parameters - tsdata.trading.OrderUpdatedEventArgs).

 

An 'event handler' is the method that runs code when the 'OrderStatusUpdate' event happens in your program. These parameters are common to event handlers, as it tells the receiver who triggered the event (elsystem.Object sender) and if there are any arguments for the event (tsdata.trading.OrderUpdatedEventArgs args - this would be data, etc).

 

In this particular example, the parameters are not used but more often than not, these parameters would be used.

 

MMS

 

Okay, so when the status of an order changes, the platform updates and maintains the info about the order change in a database. Information on the order status can be retrieved and sent to the 'Event Handler' when something detects the 'OrderStatusUpdate' event?

 

Are there some basic rules about the 'sender' and 'receiver'? I'm assuming that the 'sender' was whatever called the event handler? And the receiver is the event handler?

Share this post


Link to post
Share on other sites

Let's look that the last part of the code:

 

{Send the order when TRUE and sets the method used to handle Order Status Updated events} 
If PlaceOrderNow then begin
{Order sent only once per load in this example}
once MyOrder = OrderTicket1.Send();
MyOrder.Updated += OrderStatusUpdate;
UpdatePlots();
end;

 

'MyOrder' is a variable. I'm familiar enough with EasyLanguage to know that certain commands return an output value, and it's required to set a variable equal to the command in order to receive the output value. So the variable, 'MyOrder' is set equal to the OrderTicket1.Send() Method. This places the order.

 

Then on the next line, the variable 'MyOrder' has something appended to it.

 

MyOrder.Updated

 

I use the autocomplete, and went through the list of things available to 'MyOrder', and 'Updated' has a lightening bolt icon in front of it. I don't know what that icon stands for. There are different icons that mean different things. Okay, I just found it, the lightening bolt means that it's an Event. The Help states that 'Updated' is an Event Handler that is called whenever the object is updated. The Event Handler is called, but what does that do? I really don't know what the end result of 'MyOrder.Updated' is?

 

Now, I don't know what the plus and equal signs do in the line:

 

MyOrder.Updated += OrderStatusUpdate;

 

The OrderStatusUpdate is the subroutine name. So that makes the subroutine run. I don't know why the plus and equals signs are there?

Share this post


Link to post
Share on other sites

I guess that Events allow objects to send and receive information. A property is easy to understand. The button is blue. The Order Qty is 1. Methods cause some action. Send the Order.

 

Properties

Methods

Events

 

Events don't cause an action, but you use an Event if you want to get information, or send information about an object?

Share this post


Link to post
Share on other sites

 

Next are VARIABLES:

 

vars: tsdata.trading.Order MyOrder(NULL);

 

'vars:' is the same, but the variable 'MyOrder' is preceded with some stuff. What is this stuff?

 

Okay, maybe what it does, is set up a relationship with the variable MyOrder to the 'tsdata.trading.Order' thingy so I don't need to type that every time. So I can just type 'MyOrder' instead of 'tsdata.trading.Order'?

 

No, 'MyOrder' is simply the variable name. A variable must be declared to be of a type, most commonly an integer or a string. But here, it is of type 'tsdata.trading.Order'. So 'MyOrder' is a 'tsdata.trading.Order'

 

I do know that once the variable has been defined in that way, with 'tsdata.trading.Order' as the type of data, that the variable 'MyOrder' has options available to it.

 

I can not use:

 

tsdata.trading.Order.Cancel

 

But I CAN do this:

 

MyOrder.Cancel

 

I don't know why those two are not interchangeable.

Share this post


Link to post
Share on other sites
Okay, so when the status of an order changes, the platform updates and maintains the info about the order change in a database. Information on the order status can be retrieved and sent to the 'Event Handler' when something detects the 'OrderStatusUpdate' event?

 

Yes it usually works like that

 

Are there some basic rules about the 'sender' and 'receiver'? I'm assuming that the 'sender' was whatever called the event handler? And the receiver is the event handler?

 

The sender can be any object that initiates the event. And a receiver can be any object that chooses to listen for the event. Remember, in OO, all functions\methods are attached to an object. So 'event handler' is just a specific function on an object that contains the code that responds to the event.

 

MMS

Share this post


Link to post
Share on other sites
So the variable, 'MyOrder' is set equal to the OrderTicket1.Send() Method. This places the order.

 

More accurately, the MyOrder variable is set to the output of the OrderTicket1.Send() method. What is happening here is the OrderTicket1.Send() method returns a Order object and you are setting MyOrder to point to that object.

 

'Updated' has a lightening bolt icon in front of it.

 

These are 'events' that are initiated by the object

 

MyOrder.Updated += OrderStatusUpdate;

 

What this is doing is registering the OrderStatusUpdate 'event handler' (that we talked about in the previous post) to the event MyOrder.Updated.

 

So whenever the Updated event (on the MyOrder object) happens, it will call the event handler OrderStatusUpdate.

 

thx,

MMS

Share this post


Link to post
Share on other sites
I guess that Events allow objects to send and receive information. Events don't cause an action, but you use an Event if you want to get information, or send information about an object?

 

Events allow objects to notify other objects about its state. You use events when you want to be notified when another objects' state changed (e.g. OrderStatusUpdated). At that point, the receiving object can get all information it needs from the event arguments or from the sender of the event.

 

MMS

Share this post


Link to post
Share on other sites

I can not use:

 

tsdata.trading.Order.Cancel

 

But I CAN do this:

 

MyOrder.Cancel

 

I don't know why those two are not interchangeable.

 

Type defines the properties\functions\events\etc of an object - like a blueprint.

But an object is an instance of the Type - like a house.

 

Maybe another analogy will help here ...

 

tsdata.trading.Order == 'Human'

MyOrder == 'Mark'

 

So MyOrder is an instance of Type tsdata.trading.Order

just as 'Mark' is an instance of Type 'Human'

 

So therefore you can call 'MyOrder.Cancel'

just like you can call 'Mark.Walk'

 

But 'Human.Walk' doesn't make sense because 'Human' is just a definition. 'Mark' is the instance of that definition. Thats why you can't call 'tsdata.trading.Order.Cancel'

 

MMS

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


  • Topics

  • Posts

    • TDUP ThredUp stock, watch for a top of range breakout above 2.94 at https://stockconsultant.com/?TDUP
    • TDUP ThredUp stock, watch for a top of range breakout above 2.94 at https://stockconsultant.com/?TDUP
    • NFLX Netflix stock watch, local support and resistance areas at 838.12 and 880.5 at https://stockconsultant.com/?NFLX
    • Date: 8th April 2025.   Markets Rebound Cautiously as US-China Tariff Tensions Deepen     Global markets staged a tentative recovery on Tuesday following a wave of volatility sparked by escalating trade tensions between the United States and China. The Asia-Pacific region showed signs of stability after a chaotic start to the week—though some pockets remained under pressure. Taiwan’s Taiex dropped 4.4%, dragged lower by losses in tech heavyweight TSMC. The world’s largest chipmaker fell another 4% on Tuesday and has now slumped 13.5% since April 2, when US President Donald Trump first unveiled what he called ‘Liberation Day’ tariffs.   However, broader sentiment across the region turned more positive, with several markets rebounding sharply after Monday’s dramatic sell-offs. Japan’s Nikkei 225 surged over 6% in early trading, rebounding from an 18-month low. South Korea’s Kospi rose marginally, and Australia’s ASX 200 gained 1.9%, driven by strength in mining stocks. Hong Kong’s Hang Seng rose 1.6%, though still far from recovering from Monday’s 13.2% crash—its worst day since the 1997 Asian financial crisis. China’s Shanghai Composite added 0.9%.   In Europe, DAX and FTSE 100 are up more than 1% in opening trade. EU Commission President von der Leyen repeated yesterday that the EU had offered reciprocal zero tariffs on manufactured goods previously and continues to stand by that offer. Others are also trying again to talk to Trump to get some sort of agreement that limits the impact.   Much of the rally appeared to be driven by dip-buying, as well as hopes that the intensifying trade war could still be defused through negotiations.   China Strikes Back: ‘We Will Fight to the End’   Tensions reached a boiling point after Trump threatened to impose an additional 50% tariff on all Chinese imports unless Beijing rolled back its retaliatory measures by April 8. ‘If China does not withdraw its 34% increase above their already long-term trading abuses by tomorrow... the United States will impose additional tariffs on China of 50%,’ Trump declared on social media.   If implemented, the new tariffs would bring total US duties on Chinese goods to a staggering 124%, factoring in the existing 20%, the 34% recently announced, and the proposed 50%.   In response, China’s Ministry of Commerce issued a stern warning, stating: ‘The US threat to escalate tariffs is a mistake on top of a mistake... If the US insists on its own way, China will fight to the end.’ The ministry also called for equal and respectful dialogue, though signs of compromise on either side remain scarce.   Beijing acted quickly to contain a market fallout. State funds intervened to support equities, and the People’s Bank of China set the yuan fixing at its weakest level since September 2023 to boost export competitiveness. Additionally, five-year interest rate swaps in China fell to their lowest levels since 2020, indicating potential for further monetary easing.   Trump Talks Tough on EU Too   Trump’s hardline approach extended beyond China. Speaking at a press conference, he rejected the European Union’s offer to eliminate tariffs on cars and industrial goods, accusing the bloc of ‘being very bad to us.’ He insisted that Europe would need to source its energy from the US, claiming the US could ‘knock off $350 billion in one week.’   The EU, meanwhile, backed away from a proposed 50% retaliatory tariff on American whiskey, opting instead for 25% duties on selected US goods in response to Trump’s steel and aluminium tariffs.     Volatile Wall Street Adds to the Drama   Wall Street experienced wild swings on Monday as investors processed the rapidly evolving trade conflict. The S&P 500 briefly fell 4.7% before rebounding 3.4%, nearly erasing its losses in what could have been its biggest one-day jump in years—if it had held. The Dow Jones Industrial Average sank by as much as 1,700 points early in the day but later climbed nearly 900 points before closing 349 points lower, down 0.9%. The Nasdaq ended up 0.1%.   The brief rally was fueled by a false rumour that Trump was considering a 90-day pause on tariffs—rumours that the White House quickly labelled ‘fake news.’ The market's sharp reaction underscored how desperate investors are for any sign that tensions might ease.   Oil Markets in Focus: Goldman Sachs Revises Forecasts   Crude prices also reflected the uncertainty, with US crude briefly dipping below $60 per barrel for the first time since 2021. As of early Tuesday, Brent crude was trading at $64.72, while WTI hovered around $61.26.   Goldman Sachs, in a note dated April 7, lowered its average price forecasts for Brent and WTI through 2025 and 2026, citing mounting recession risks and the potential for higher-than-expected supply from OPEC+.       Under a base-case scenario where the US avoids a recession and tariffs are reduced significantly before the April 9 implementation date, Goldman sees Brent at $62 per barrel and WTI at $58 by December 2025. These figures fall further to $55 and $51, respectively, by the end of 2026. This outlook also assumes moderate output increases from eight OPEC+ countries, with incremental boosts of 130,000–140,000 barrels per day in June and July.   However, should the US slip into a typical recession and OPEC production aligns with the bank’s baseline assumptions, Brent could retreat to $58 by the end of this year and to $50 by December 2026.   In a more bearish scenario involving a global GDP slowdown and no change to OPEC+ output levels, Brent prices might fall to $54 by year-end and $45 by late 2026. The most extreme projection—based on a simultaneous economic downturn and a full reversal of OPEC+ production cuts—would see Brent plunge to below $40 per barrel by the end of 2026.   Goldman noted that oil prices could outperform forecasts significantly if there was a dramatic shift in tariff policy and a surprise in global demand recovery.   Cautious Optimism, But Warnings Persist   With both Washington and Beijing showing no signs of backing down, markets are likely to remain volatile in the days ahead. Investors now turn their attention to upcoming trade meetings and policy decisions, hoping for clarity in what has become one of the most unpredictable trading environments in recent years.   Always trade with strict risk management. Your capital is the single most important aspect of your trading business.   Please note that times displayed based on local time zone and are from time of writing this report. Click HERE to access the full HFM Economic calendar.   Want to learn to trade and analyse the markets? Join our webinars and get analysis and trading ideas combined with better understanding of how markets work. Click HERE to register for FREE!   Click HERE to READ more Market news.   Andria Pichidi HFMarkets   Disclaimer: This material is provided as a general marketing communication for information purposes only and does not constitute an independent investment research. Nothing in this communication contains, or should be considered as containing, an investment advice or an investment recommendation or a solicitation for the purpose of buying or selling of any financial instrument. All information provided is gathered from reputable sources and any information containing an indication of past performance is not a guarantee or reliable indicator of future performance. Users acknowledge that any investment in Leveraged Products is characterized by a certain degree of uncertainty and that any investment of this nature involves a high level of risk for which the users are solely responsible and liable. We assume no liability for any loss arising from any investment made based on the information provided in this communication. This communication must not be reproduced or further distributed without our prior written permission.
    • CVNA Carvana stock watch, rebound to 166.56 support area at https://stockconsultant.com/?CVNA
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.