油厂大豆提油套利价差计算与公式源码
大豆压榨利润代表大豆生产者的收益。当压榨利润为正值时,购买大豆并销售成品将获得盈利;当其为负值时,则可能出现反向压榨,即销售产品并购买大豆。
{ Data1 = 大豆价格
Data2 = 豆油价格
Data3 = 豆粕价格 }
Input:OilRatio(0.185),MealRatio(0.785),ProcessingFee(150);Vars:OilPrice(0),MealPrice(0),SoyPrice(0),CrushMargin(0),OilValue(0),MealValue(0);OilPrice = Close of Data(2);MealPrice = Close of Data(3);SoyPrice = Close of Data(1);OilValue = OilPrice * OilRatio;MealValue = MealPrice * MealRatio;CrushMargin = OilValue + MealValue - SoyPrice - ProcessingFee;Plot1(CrushMargin, "Crush Margin");Plot2(0, "Zero Line");If CrushMargin > 0 ThenSetPlotColor(1, Green)ElseSetPlotColor(1, Red);
运行效果:









夜雨聆风