Book Review: Teach Yourself Coding Indicators in PineScript

 PineScript is a TradingView Platform Programming script, designed for the development of custom indicators in TradingView Platform. The e-Book and paperback book - " Teach Yourself Coding Indicators in PineScript" are available on Amazon in its various markets.

This book is intended for beginners with no or little knowledge of computer programming. In case you are an experienced programmer, I would suggest you go through the PineScript manual available on the TV website as you will find that the content is more targeted towards beginners with no prior programming experience.

The author of the book has about 20 years of experience in programming and has the patience to teach hard concepts with simple examples. This man can really teach any beginner. The author is also an instructor at Udemy for the course "Creating trade strategies & backtesting using PineScript" wherein also the author has earned a reputation and good reviews from his students.

In any case, learning PineScript will profit you when you start to apply programming skills gained to real problems. You will be able to take full advantage of the TradingView Platform by understanding the concepts and logic behind the trade scripts of other pine programmers.

The book starts with basic concepts like variables and their types which have been explained neatly with nice examples and are intended for learners with no programming skills. The codes are put in separate boxes and each code is followed by the result and then line by line explanation. The book has separate chapters on errors generated while compilation of script. The solution to identify errors and to correct them is also provided in the book. The book has codes with neat explanations for identification of doji, plotting moving average crossover, plotting of zigzag indicator, identifying BAT harmonic pattern, and plotting of other indicators.

The only drawback in the paperback book is that it is not colored and sometimes I had to really struggle to understand charts printed in the book. The e-book has been priced at USD 2.99 and the paperback book has been priced at USD 6.36.

I recommend this book to all serious learners who want to apply technicals to charts. By using this book and learning codes, you will also be able to by-pass the limitation put on by TradingView on the maximum number of indicators that a user may use in a basic free version of TradingView.

International Trade: Variance in price after contracting

 During the 2008–09 crisis prices of almost all commodities fall unprecedently. This resulted in the failure of many contracts. Liquidated damages are since on actual losses and not on notional losses, the same also could not be recovered by the injured party.

Prices of many commodities are fairly available on exchanges and publication Many commodities are traded in future or spot exchanges. Some of the commodities like coal, bunker fuel have an index. Prices of Crude palm is published regularly by the Malaysian Palm Oil Council (MPOC). The buyer is always aware of the international price before entering any contract. Say I want to buy coal from Indonesia then, I already have coal prices of New Castle, Argus, and Platts publications in my hand before the negotiation.

Often prices quoted by the supplier are compared with the index prices to have a fair idea of prices. Say, the supplier is offering a discount of USD 2 over-index price or the supplier is asking USD 7 above index prices. In case of long term contracts or contracts where supplies are expected to be distributed over long period, it is suggested to have “variable price” in place of fixed price in the contract.

Case Situation: A Thermal Power Plant needs steam coal at the rate of 50,000 MT per month for the next year. 50,000 MT is approx one vessel per month. In case a single contract with a fixed price is signed between buyer and seller and there is movement in price, either supplier or Buyer, one of the two will be at loss. A possible solution could be to re — negotiate the price at the end of every month and sign a separate contract for each vessel monthly. The second option is feasible and can save buyers and sellers from possible fluctuation in prices. However, there would be always uncertainty associated with supplies. Suppose in a month, the contract could not be finalized due to non-agreement of prices and another supplier quotes below the price offer made by the established supplier. Supplier and buyer both in this case have risk. Supplier in the absence of firm order would not source and keep material ready for shipment and buyer in the absence of firm supplier is at the risk of production loss at the thermal power plant.

The possible solution to the problem was developed by the Indian Thermal Power Plant procurement department in 2008–09, the price of steam coal was linked to the index price. For import from Indonesia, Argus Indonesian Index is adopted as a basis and for import from other countries, a combination of two to three indices is taken. For example for 5800 KCal coal, the index adopted by some thermal power plant is 50:25:25 of three indices Richard Bay API4 for 6000 Kcal/Kg NCV, Newcastle Export Index (NEX) for 6700 Kcal/Kg GAD and Global Coal New Castle (GCNEW C) for 6000 Kcal/Kg NCV.

A synthetic index is created by blending all the three indices and FOB price offered by the supplier is compared to this synthetic index. Say the price is at a premium of 2% to this index and the same is finalized for a contract of one year. The FOB price shall also fluctuate and shall always remain at 2% premium of this synthetic index. The payment is made by calculating the synthetic index rate on the date of Bill of Lading based on the three weekly publications.

Why three indices ?

During 2008–09, the Indonesian coal index was at a nascent stage. The market in Australia and Africa were more organized. However, the coal sought by the power plant was of different specification and was normally sourced from Indonesia only. These three indexes were selected because they have developed market, robust data reporting, and the oldest. The three were mixed in different ratios to arrive at a synthetic index so that the index price is comparable with the Indonesian coal price.

For more on International Trade : Guide to Import Export for Beginners

International Trade: Liquidated Damages and Dispute

 Liquidated Damages are damages in the form of an amount that both parties agree to as compensation to the injured party in the event of a breach of contract. The clauses for Liquidated Damages are generally included in the contract and non-insertion of such a clause in the contract may render the injured party in a weak position in the event of a breach of the agreement.

In case of an import contract, the buyer may like to have liquidated claused for the delay in shipment or non-supply of material by the supplier. In the case of delay, the penalty on delay on a shipment is made in terms of USD per MT per day. More is the delay more is the penalty. However, to be legally correct, the buyer is also required to put a maximum number of days that may be allowed for the delay and after which the buyer has the right to terminate the contract and seek compensation from the supplier.

In this article, we will examine various facts on these penalties and their legal tenability.

Force Majeure and Liquidated Damages

Force Majeure conditions can help in avoiding Liquidated Damages. As soon as force Majeure conditions appear, the supplier must at least inform the buyer of its occurrence. In case, despite the occurrence of Force Majeure condition, Supplier fails to inform Buyer of its occurrence, the same cannot be entertained at a later date at the stage of legal argument.

Case Situation: Vessel while loading broke down and due to intervening holidays of X’mas and new year could not be repaired and was delayed. The supplier communicated the reason for the delay to the buyer, however, the Buyer claimed 3 days liquidated damages @USD 2 per MT for 19000 MT of grains. As per the contract, a letter from the Chamber of Commerce was required for claiming relief under Force Majeure. The supplier was not able to obtain this certificate as the situation though out of control of the supplier, was restricted only to their vessel.

What is your opinion on the above case ? In my opinion, on the production of documents from the port authority or master of the ship, relief should have been provided to the supplier. Blindly sticking to the Force Majeure clause by the buyer in their favor resulted in arbitration between the two parties, where they settled the case amicably. Force Majeure clause or any other clause cannot be complete in itself. They only provide intent to resolve disputes or provide general guidelines. What if, there would have been a Liquidation clause in the contract and no Force Majeure clause. In all such cases, the International court would have taken “intent” of the party and would have interpreted the law accordingly. I have seen in my career that in most of the cases, Shipping Lines get the benefit of any ambiguity as ships are machines and breakdowns cannot be predicted. The intention of the shipmaster was not to stop the ship and neither the intention of the supplier was to delay or not to supply. These parties have not gained anything from the delay and hence waiver should be provided in such cases.

Recovery of Losses for non-shipment

In the event of non-shipment, the Buyer has the right to claim for losses. Now let's take an example.

Case Situation: Supplier failed to Supply 1000 MT grain to the buyer as per the shipment schedule. The buyer claimed Liquidated Damages from the supplier by calculating the difference between the market price at the time of contractual arrival date and its purchase cost. Of course, the purchase cost (CIF) was below the market price at disport.

The above damages have been calculated and claimed on the assumption that the material would have been sold on the date of arrival. Thus, this loss is a notional loss and not the actual loss. The above claim of damages cannot be made and if made the same cannot sustain as per international Contract Law.

The claim for damages can only be made, if the actual purchase was done by the buyer at a price higher than the price of the initial purchase and the quantum of such loss can be different between the prices of two purchases.

For more on International Trade : Guide to Import Export for Beginners